<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
$.getJSON("http://******/Wxopen/signature?url="+window.location.href+"&callback=?",function(data){
$.each(data,function(k,v){
wx.config({
debug: true,
appId: '*****',
timestamp:v.time,
nonceStr:v.noncestr,
signature: v.signature,
jsApiList: [
'onMenuShareTimeline',//分享朋友圈
'onMenuShareAppMessage',//分享给好友
'onMenuShareQQ',//分享到QQ
'onMenuShareWeibo',//分享腾讯微博
]
});
});
});
var wxtitle="标题标题";//标题
var wxlink="";//默认为空
var wximg="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png";//图标
var wxdesc="描述描述描述";//描述(分享给微信/QQ好友/微博时显示)
wx.ready(function () {
wx.onMenuShareTimeline({
title: wxtitle, // 分享标题
link: wxlink, // 分享链接
imgUrl: wximg, // 分享图标
success: function () {
// 用户确认分享后执行的回调函数
},
cancel: function () {
// 用户取消分享后执行的回调函数
}
});
wx.onMenuShareAppMessage({
title: wxtitle,
desc: wxdesc,
link: wxlink,
imgUrl: wximg,
type: '', // 分享类型,music、video或link,不填默认为link
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
success: function () {},
cancel: function () {}
});
wx.onMenuShareQQ({
title: wxtitle,
desc: wxdesc,
link: wxlink,
imgUrl: wximg,
success: function () {},
cancel: function () {}
});
wx.onMenuShareWeibo({
title: wxtitle,
desc: wxdesc,
link: wxlink,
imgUrl: wximg,
success: function () {},
cancel: function () {}
});
});
用微信 JS 接口签名校验工具已经验过签名没问题...为什么IOS不行呢, 就是安卓能用, IOS不行
debug:
"errorMsg":"config fail"
"checkResult":"onMenuShareTimeline:true,onMenuShareAppMessage:true,";" errMsg :checkJsApi:ok"
我做过分享的SJSDK,安卓苹果都可以的。你可以在调用接口的时候弹出参数,一步一步去分析错误