1、github上已有的插件:https://github.com/nwpuhmz/ShareSDKPlugin
2、安装插件
cordova plugin add https://github.com/nwpuhmz/ShareSDKPlugin --variable wechatappid=YOUR_APPID --variable SHARESDKAPPID=YOUR_SHARESDKAPPID --variable WECHATAPPSECRET=YOUR_WECHATAPPSECRET
3、插件调用
var message = {
title: "我",
content: "ah",
url: "http://www.baidu.com",
imagePath: "http://ac-p9y5fh0m.clouddn.com/c28cb93e9a0eae4b3b11.jpg"
};
ShareSDK.share(message,null,null);
4、AppID的配置标志和秘钥(微信开发平台和QQ互联平台注册取得)
(1 QQ:app_id
(2 wechat: app_id app_secret
5、SDK不支持bitcode的话,关闭bitcode
Build Settings => Build options =>Enable bitcode =>NO
6、添加Scheme
在项目的info.plist中添加一LSApplicationQueriesSchemes,类型为Array
对应的QQ和微信白名单(http://wiki.mob.com/ios9-%E5%AF%B9sharesdk%E7%9A%84%E5%BD%B1%E5%93%8D%EF%BC%88%E9%80%82%E9%85%8Dios-9%E5%BF%85%E8%AF%BB%EF%BC%89/):
- mqqOpensdkSSoLogin,
- mqqopensdkapiV2,
- mqqopensdkapiV3,
- wtloginmqq2,
- mqq,
- mqqapi
- wechat,
- weixin
7、QQ无法跳转的问题
URL types =>URL Schemes => 添加一个item,值就是:QQ+0 +AppID 转化成16进制