I need to implement javascript where I can determine if my deep link is working or not. If it works, then it should remain the same, but if it does not work, it should start downloading the file. To do this, I use the timeout function to do this. Here is an example of the code I used.
setTimeout(function () { window.location = "https://itunes.apple.com/appdir"; }, 25);
window.location = "appname://";
But this code works fine on Android and ios, but it poses a problem when it comes to the desktop browser. In the desktop browser, after the correct operation of Deeplink, the timeout function does not stop and is redirected to the download page.
so finally I need some kind of event that can determine if my Deeplink is working or not, so I can set the cleartimeout function to prevent the URL from redirecting to load
source
share