adding social share links to phonegap app

馋奶兔 提交于 2019-11-30 19:10:24

问题


i have an app that is using jquery mobile and it outputs and image.

now i have displayed the image in a preview page and i have added links below to share them on facebook and twitter and other platforms

how do i go about coding it...

when the user click on the share button the default share pannel should pop up like this

https://cdn.tutsplus.com/mobile/uploads/legacy/Android-SDK_Share-Activity/android_share_chooser.png

when the user select for example twitter the twitter app opens and the image should be attached.

How can this be achived..should i be looking in the apis of the social site or android api or phonegap api


回答1:


PhoneGap Social Sharing plugin for Android, iOS and Window

Install with the CLI

cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git

Add in your page

<button onclick="window.plugins.socialsharing.share('Message, image and link', null, 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, image and link</button>
<button onclick="window.plugins.socialsharing.share('Message, subject, image and link', 'The subject', 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, subject, image and link</button>

More...



来源:https://stackoverflow.com/questions/26779784/adding-social-share-links-to-phonegap-app

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