Add PhoneGap app to “share” menu on Android and IOS

╄→尐↘猪︶ㄣ 提交于 2019-12-08 07:42:39

问题


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

This is basically what i am talking about:

  1. User is on Chrome and wants to share a particular page url
  2. Instead of copying the link into the clipboard and manually running the app, the user can select the "share" option and choose my application from the list

I am using PhoneGap Build service to build my application.

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)

Has anybody implemented this via PhoneGap and PhoneGap Build?

Thank you.


回答1:


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>

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



来源:https://stackoverflow.com/questions/36910059/add-phonegap-app-to-share-menu-on-android-and-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!