在某些ios版本的app上,通过web 调用app存在失败的设想,通过联调
发现JSbridge 这个中央并没有发送申请
var WVJBIframe = document.createElement('iframe');
WVJBIframe.style.display = 'none';
WVJBIframe.src = 'wvjbscheme://__BRIDGE_LOADED__';
测试了很久,认为是app缓存了iframe的申请造成的问题,
起初一想没准iframe 提早创立,再赋予 WVJBIframe.src值的时候是空的对象,并没有负值胜利
所以代码追加了 setTime 测试失常了
setTimeout(function(){
WVJBIframe.style.display = 'none';
WVJBIframe.src = 'wvjbscheme://__BRIDGE_LOADED__';
document.documentElement.appendChild(WVJBIframe);
setTimeout(function () {
document.documentElement.removeChild(WVJBIframe)
}, 0);
sessionStorage.phoneType = 'ios'
},100)
此问题只在局部零碎版本中呈现,大部分没有问题。
发表回复