简体   繁体   English

从浏览器共享URL到android中的其他应用程序

[英]Share Url from browser to other apps in android

I am working on a website and the requirement is that user's can share a page, link or image 我正在网站上工作,要求是用户可以共享页面,链接或图像

I want to make a share button on my webpage which allows user to share a link, image, etc via the apps installed in the user's phone. 我想在我的网页上创建一个分享按钮,允许用户通过用户手机中安装的应用程序共享链接,图像等。 How can I achieve that. 我怎样才能做到这一点。

It's should be like the share panel as shown in the image below 它应该像共享面板一样,如下图所示

在此输入图像描述

Not very clear about the question. 对这个问题不太清楚。 But from what I understand, you want to share a particular page from your app, so it can be visited using a shareable link. 但据我所知,您希望从应用程序共享特定页面,因此可以使用可共享链接访问该页面。

I think you're looking for is Deep Linking . 我认为你正在寻找的是Deep Linking


Update: HTML Sharing Buttons: https://www.addtoany.com/buttons/for/website 更新:HTML共享按钮: https//www.addtoany.com/buttons/for/website

I believe that the Web Share API is what you are looking for. 我相信Web Share API正是您所寻找的。

It allows you to initiate the share intent via javascript. 它允许您通过javascript启动共享意图。 Android then displays the exact same share popup as in native apps. Android然后显示与本机应用程序完全相同的共享弹出窗口。

Example from MDN: 来自MDN的示例:

navigator.share({
  title: document.title,
  text: 'Hello World',
  url: 'https://developer.mozilla.org',
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM