简体   繁体   中英

In Iphone, Ipad and using Safari Browser - An alert “Open with myapp”

In iOS using Safari Browser, an alert "Open with xyz app" is showing before redirect on app if app installed and an alert "Invalid address" then "Open with app store" if app not installed.

Is there a way to redirect on app if installed otherwise on app store without showing any alert? Like yelp.com?

Currently I am trying it using java script but it is showing an alert.

document.location.href = "myapp://url?url=" + encodeURIComponent(window.location.href);// "myapp://?url=" + encodeURIComponent(window.location.href);
setTimeout(function () {document.location.href = "appstoreurl";}, 2000);

Can anyone help me to resolve this issue?

Yes you can.

For this you need to setup Universal Links . You should read the documentation here:

https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html

The way you are doing it is "deprecated" since iOS 9

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM