插件地址:
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>
- 大小: 15.1 KB
- 大小: 75.3 KB
- 大小: 81.9 KB
- 大小: 87.6 KB
- 大小: 14.5 KB
分享到:
相关推荐
NULL 博文链接:https://rensanning.iteye.com/blog/2032663
NULL 博文链接:https://rensanning.iteye.com/blog/2034026
NULL 博文链接:https://rensanning.iteye.com/blog/2042543
NULL 博文链接:https://rensanning.iteye.com/blog/2023480
NULL 博文链接:https://rensanning.iteye.com/blog/2047322
NULL 博文链接:https://rensanning.iteye.com/blog/2029362
NULL 博文链接:https://rensanning.iteye.com/blog/2036318
NULL 博文链接:https://rensanning.iteye.com/blog/2021619
NULL 博文链接:https://rensanning.iteye.com/blog/2054646
Cordova 3.x(aka PhoneGap)的基础知识、实用插件、源码分析、实例开发。
实实在在经过ant编译的cordova-2.9.1.jar 而不是有些人坑蒙拐骗的rar文件