Call the sharing interface in WeChat js-sdk to modify the page sharing content and pictures. It has been tested that the pictures and titles shared by Android are successfully modified, but there are no changes when shared by Apple phones. I don’t know whether there is a problem with Apple compatibility or not. what reason
業(yè)精于勤,荒于嬉;行成于思,毀于隨。
In iOS WeChat version 6.1, the external links of shared pictures are not displayed. Only pictures linked within the official account page or pictures from the WeChat server can be displayed (WeChat team has confirmed this problem and will fix it in 6.2)
Now this problem generally does not occur. After all, the current iOS version is generally above 8.2. I also often create WeChat h5 pages and share iOS without any problems. I personally think there is a problem with the code, or you can post some code and take a look
Damn, I accidentally discovered that after adding http to the link in the code, ios becomes normal. What the hell, ios doesn’t have http and he can’t recognize it! Modified pictures and links must be preceded by http! !
wx.config({
debug: false,
appId: '<?php echo $signPackage["appId"];?>',
timestamp: '<?php echo $signPackage["timestamp"]?>',
nonceStr: '<?php echo $signPackage["nonceStr"];?>',
signature: '<?php echo $signPackage["signature"];?>',
jsApiList: [
'onMenuShareTimeline','onMenuShareAppMessage'
]
});
wx.ready(function(){
wx.onMenuShareTimeline({
title: "<{$product_info.info.title}>", // 分享標題
link: "http://www.xxxx.com<{:U('Home/Product/Index/product_details',array('product_id'=>$product_info['info']['id']))}>", // 分享鏈接,該鏈接域名或路徑必須與當前頁面對應(yīng)的公眾號JS安全域名一致
imgUrl: 'http://www.xxxx.com<{$product_info.info.cover|thumb=300,300,M}>', // 分享圖標
success: function () {
// 用戶確認分享后執(zhí)行的回調(diào)函數(shù)
},
cancel: function () {
// 用戶取消分享后執(zhí)行的回調(diào)函數(shù)
}
});
});