Before iOS 9, one way to check whether an app was installed on the iPhone from javascript was to use a custom URI scheme followed by a timeout:
window.location = "yourapp://";
setTimeout(function() {
window.location = "https://yourdomain.com";
}, 25);
If the app was installed- it would open the app and the timeout would never execute since javascript would stop executing when the app would open.
But in safari on iOS 9+, the line window.location = "yourapp://";
displays a pop-up asking the user if he wants to open the app. Basically, due to this the Javascript is not blocked from executing and the timeout executes before the app opens and so instead of the app, the appstore opens.
Tl;dr- In iOS 9+, in Safari, if the app is installed, even then the appstore will be opened with this code. Hence, this code cannot be used anymore to check when the app is installed and when it isn't.
So is there a way to check if an app is installed on iPhone running iOS 9+, from Javascript in a webpage?