Working with deep linking, I have the code snippet below on my web page.
The code works fine on Chrome but on Safari, I just get a message to say it could not find the deep link without redirecting.
On Chrome, it redirects to the relevant store if the app is not found.
"Safari cannot open the specified address: myapp://
I tried wrapping in a try catch block but to no avail. Any help is appreciated.
setTimeout(function () {
if(navigator.userAgent.toLowerCase().indexOf("android") > -1) {
window.open("http://play.google.com/store/apps/details?id=com.myapp","_top");
}
else if (navigator.userAgent.toLowerCase().indexOf("iphone") > -1) {
window.open("https://apps.apple.com/us/app/myapp","_top");
}
}, 2000);
window.location = "myapp://";