javascript - What happens when the local ID obtained in the jssdk image selection API can be used as a URL on the Android side but cannot be used on the ios side?
ringa_lee
ringa_lee 2017-05-16 13:34:52
0
1
516

jssdk select image interface api--chooseImage. The local image ID returned after selecting the local image can itself be used as a link to the image. On the Android machine, I set it as a background image without any problem, but on ios After selecting the picture, the id returned is also not displayed as the URL of the background image. What is the problem? Can anyone please explain it!

ringa_lee
ringa_lee

ringa_lee

reply all(1)
我想大声告诉你

The WeChat iOS client will be gradually upgraded to the WKWebview core before March 1, 2017. Web developers need to do compatibility checks and adaptation of the website in advance.

Change: JSSDK versions below 1.2.0 no longer support previewing images by using the localld returned by the chooseImage api such as: "img src=wxLocalResource://50114659201332".
Adaptation suggestion: Directly upgrade the JSSDK to the latest version 1.2.0 to help the page automatically adapt, but it may not be effective in some scenarios. In this case, you can use the getLocalImgData interface to directly obtain the data.
wx.getLocalImgData({

localId: '', // 图片的localID
success: function (res) {
    var localData = res.localData; // localData是图片的base64数据,可以用img标签显示
}

});

https://res.wx.qq.com/open/js...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template