wx.onMenuShareTimeline({
title: shareData.title, // Share title
link: shareData.link, // Share link
imgUrl: shareData.imgUrl, // Share icon
success: function () {
alert(123);
},
cancel: function () {
}
});
The ios callback success method does not execute, the cancel method executes with no problem, and the Android machine has no problem. Can anyone explain why? How to solve it
阿神2017-05-16 13:04:14
It’s not a problem of non-execution, it’s that the alert is blocked on iOS, so if you want to prompt something, you can only use js to control p to pop up the prompt box.
我想大声告诉你2017-05-16 13:04:14
It may not be the reason for iOS and Android systems.
The difference may be caused by the different WeChat versions of the two mobile phones.
Recently regarding sharing, WeChat has upgraded to the latest version and has strict requirements on shared links, which must be page links under JS secure domain names.
If it is not the above problem, you can
wx.config({
debug: true, // 开启调试模式,
})
查找具体原因。
怪我咯2017-05-16 13:04:14
I ate a lot of shit a few days ago because of this. . . .
For example, if your html is at http://abc.com/index.html, then those sharing links must also be under the same domain name
If different domains: Some machines are normal and some are abnormal.
(And the most important thing is: WeChat’s development documentation has two versions, one version points out this, one does not point it out, it’s simply wonderful. According to the code given in your problem description, it is the latter, I guess I’ve tricked a lot of people)
. . . Of course, I feel that your problem is caused by different domains. . . . .