问题
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:
- User is on Chrome and wants to share a particular page url
- 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