problem description
Wechat official account: updateAppMessageShareData
and updateTimelineShareData
methods are triggered when ios phones enter the page, and
the environmental background of the problems and what methods you have tried
Service number development, consulted the documentation, but did not find a solution
related codes
$(function(){
var script=document.createElement("script");
script.type="text/javascript";
script.src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js";
document.getElementsByTagName("head")[0].appendChild(script);
script.onload=function(){
fetch("/api/we/chat/share","POST",{
url:location.href.split("-sharp")[0]
}).then(res => {
if(res.state == 200){
console.log(res);
wx.config({
debug: false,
appId: res.data.appid,
timestamp: res.data.timestamp,
nonceStr: res.data.nonceStr,
signature: res.data.signature,
jsApiList: ["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","updateTimelineShareData","updateAppMessageShareData"]
});
wx.ready(function () {
wx.onMenuShareTimeline({
title: "", //
desc: "", //
link: url_+"/xu-gong/html/into.html",
imgUrl: getRootPath()+"xu-gong/img/logo.jpg", //
success: function () {
shareEgg()
}
});
wx.onMenuShareAppMessage({
title: "", //
desc: "", //
link: url_+"/xu-gong/html/into.html",
imgUrl: getRootPath()+"xu-gong/img/logo.jpg", //
success: function () {
shareEgg()
}
});
});
// alert(location.href.split("-sharp")[0])
wx.updateAppMessageShareData({
title: "", //
desc: "", //
link: url_+"/xu-gong/html/into.html",
imgUrl: getRootPath()+"xu-gong/img/logo.jpg", //
success: function () {
//
shareEgg()
}
});
wx.updateTimelineShareData({
title: "", //
desc: "", //
link: url_+"/xu-gong/html/into.html",
imgUrl: getRootPath()+"xu-gong/img/logo.jpg", //
success: function () {
//
shareEgg()
}
});
}else{
layer.msg(res.message,{time:1500});
}
})
}
});
what result do you expect? What is the error message actually seen?
these two events are triggered only when sharing