I've been looking for a way to open a native iOS app from the browser. I found a decent solution here: Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
This solution works great when you have the app installed. but when a user doesn't have this app installed - safari fires an error message which says "Safari cannot open the page because the address is invalid."
Is there a way to prevent this behaviour and instead to prompt the user to download the app?
The right way to do this is to use Smart App Banners: https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
If your app is not installed, the banner will let the user install it. If it is installed, it will open the app, and you have a way of specifying custom URL arguments to pass to the app.
Here is a solution that works for me:
I'm using meta refresh as fallback because this works without javascript. This code works in iOS and Android.
Test http://static-pmoretti.herokuapp.com/deep-link/
For solving this and avoid no wanted iOS safari alert I've used a different approach handle also an iframe but without jquery and listener events. It works perfectly.
use iframe.