将PhoneGap应用添加到“共享" Android和IOS上的菜单 [英] Add PhoneGap app to "share" menu on Android and IOS

查看:75
本文介绍了将PhoneGap应用添加到“共享" Android和IOS上的菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以将我的PhoneGap应用程序添加到android和ios共享"屏幕.

I am wondering whether it is possible to add my PhoneGap application to android and ios "share" screens.

这基本上是我在说的:

  1. 用户正在使用Chrome,并且希望共享特定的页面网址
  2. 用户可以选择共享"选项,然后从列表中选择我的应用程序,而不是将链接复制到剪贴板中并手动运行该应用程序

我正在使用PhoneGap Build服务来构建我的应用程序.

I am using PhoneGap Build service to build my application.

我一直在网上搜索,这里在StackOverflow上,这里有适用于android的插件解决方案,但我似乎找不到适用于ios的任何东西.另外,我找到的解决方案适用于相反的情况(即,将数据从我的应用程序共享到另一个应用程序)

I have been searching online and here on StackOverflow and there are plugin solutions for android but i can't seem to find anything for ios. Plus, the solutions i found are for the opposite scenario (i.e. sharing data from my application to another application)

有人通过PhoneGap和PhoneGap Build来实现吗?

Has anybody implemented this via PhoneGap and PhoneGap Build?

谢谢.

推荐答案

要在phonegap Build中实现该功能,您需要创建一个自定义插件. 如果您在本地安装了phonegap/cordova,则可以添加以下内容

To implement that in phonegap Build you'll need to create a custom plugin. if you have a phonegap/cordova installed locally then you can add the following

<intent-filter>
     <action android:name="android.intent.action.SEND" />
     <category android:name="android.intent.category.DEFAULT" />         
</intent-filter>

放入位于项目platforms/android文件夹内的android-manifest.xml. 有关更多信息,请参见此答案.

into android-manifest.xml which is located inside platforms/android folder of your project. for more have a look at this answer.

这篇关于将PhoneGap应用添加到“共享" Android和IOS上的菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆