在调试模式下,config反馈ok,使用低版本支持的onMenuShareAppMessage和onMenuShareTimeline也都正常工作,但换成官方建议的updateAppMessageShareData和updateTimelineShareData,
在开发者工具上会报错:updateTimelineShareData:fail, the permission value is offline verifying
在安卓微信 7.0.10 版本会报错:updateTimelineShareData:permission denied
其中,config里有配置需要用到的jsApiList
其次,在ready里调用checkJsApi,且checkJsApi里也写了新旧两种的jsApiList,手机上debug,显示新旧两种jsApiList都可用,再在success里调用的updateTimelineShareData,结果说permission denied
复现链接:
https://test-www.sanguozhan888.com/share/wechat/?uid=10013
wx.config({
debug: true,
appId: config_info.appId,
timestamp: config_info.timestamp,
nonceStr: config_info.nonceStr,
signature: config_info.signature,
jsApiList: [
'checkJsApi',
'onMenuShareAppMessage',
'onMenuShareTimeline',
'updateAppMessageShareData',
'updateTimelineShareData'
]
});
wx.ready(function () {
wx.checkJsApi({
jsApiList: [
'onMenuShareAppMessage',
'onMenuShareTimeline',
'updateAppMessageShareData',
'updateTimelineShareData'
], // 需要检测的JS接口列表,所有JS接口列表见附录2,
success: function(res) {
console.log('checkJsApi:', res)
if (res.checkResult.updateAppMessageShareData || res.checkResult.onMenuShareAppMessage) {
wx.updateAppMessageShareData({
title: 'XXX', // 分享标题
desc: 'XXXXXX', // 分享描述
link: 'https://test-www.sanguozhan888.com/share/wechat/?uid=10013', // 分享链接
imgUrl: 'https://test-www.sanguozhan888.com/share/imgs/share300.png', // 分享图标
success: function (data) {
// 设置成功
console.log('updateAppMessageShareData success:', data);
},
fail: function(error) {
console.log('updateAppMessageShareData error:', error);
}
});
}
if (res.checkResult.updateTimelineShareData || res.checkResult.onMenuShareTimeline) {
wx.updateTimelineShareData({
title: 'XXX', // 分享标题
link: 'https://test-www.sanguozhan888.com/share/wechat/?uid=10013', // 分享链接
imgUrl: 'https://test-www.sanguozhan888.com/share/imgs/share300.png', // 分享图标
success: function (data) {
// 设置成功
console.log('updateTimelineShareData success:', data);
},
fail: function(error) {
console.log('updateTimelineShareData error:', error);
}
});
}
}
});
});
希望官方可以帮忙查看一下,翻看过社区里的帖子,能试的都试过了,都无法工作(官方有说法旧的要快废弃了,但新的又无法工作怎么办)