社交分享 SocialSharing

插件地址:https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin

(1)创建工程

引用

cordova create HelloSocialSharing com.rensanning.cordova HelloSocialSharing 
cd HelloSocialSharing 
cordova platform add android

(2)安装 plugin

引用

cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
(3)修改 index.html 后编译执行

Html 代码

<a href="#" class="btn" onclick="window.plugins.socialsharing.share('Message only')">Share Message</a>
<a href="#" class="btn" onclick="window.plugins.socialsharing.share(null, null, 'http://www.baidu.com/img/bdlogo.gif', null)">Share Image</a>
<a href="#" class="btn" onclick="window.plugins.socialsharing.shareViaSMS('My cool message', null, function(msg) {console.log('ok: ' + msg)}, function(msg) {alert('error: ' + msg)})">Share via SMS</a>

联系我们

邮箱 626512443@qq.com
电话 18611320371(微信)
QQ群 235681453

Copyright © 2015-2024

备案号:京ICP备15003423号-3