ios schema唤起app出现的各种异常问题
Author:zhoulujun Date:
在开发app下载download页面中,各种问题,搞死人。
在android里面,html5里面iframe通过schema唤起app是没有问题。但是,在ios中,iframe也会有问题。
在uc中,出现404,不明觉厉
唤起app,不然强制跳转到app-store
然后,最终办法,修改如下;
function openAppFunc() {
var url = $("#url").val();
var sourceType = $("#sourceType").val();
var openUrl = 'sfpay://splash?menu=' + sourceType + '&url=' + url;
if (browser.versions.ios) {
location.href = openUrl;
setTimeout(function() {
window.location = 'itms-apps://itunes.apple.com/us/app/imdb-movies-tv/id342792525'
}, 250);
} else {
var ifr = document.createElement('iframe');
ifr.src = openUrl;
ifr.style.display = 'none';
document.body.appendChild(ifr);
window.setTimeout(function() {
document.body.removeChild(ifr);
}, 3000);
}
};
转载本站文章《ios schema唤起app出现的各种异常问题》,
请注明出处:https://www.zhoulujun.cn/html/OS/IOS/IOS-Develop/2017_0420_7996.html