javascript - WeChat sharing interface modification of sharing links and pictures does not work on Apple ios
迷茫
迷茫 2017-06-13 09:22:09
0
4
1568

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

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(4)
某草草

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

过去多啦不再A梦

The js files introduced on ios must support https

typecho

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']))}>", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
        imgUrl: 'http://www.xxxx.com<{$product_info.info.cover|thumb=300,300,M}>', // 分享图标
        success: function () { 
            // 用户确认分享后执行的回调函数
        },
        cancel: function () { 
            // 用户取消分享后执行的回调函数
        }
    });
});
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!