Cordova適用插件 之 社交分享SocialSharing

tags:    時間:2014-03-23 13:54:54
Cordova實用插件 之 社交分享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后編譯執行
<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>


 
 

推薦閱讀文章

Bookmark the permalink ,來源:互聯網