Skip to content

Instantly share code, notes, and snippets.

@munky69rock
Created January 18, 2013 07:02
Show Gist options
  • Save munky69rock/4562867 to your computer and use it in GitHub Desktop.
Save munky69rock/4562867 to your computer and use it in GitHub Desktop.
iPhone Safari: check if URL scheme is supported in javascript
// cf: http://stackoverflow.com/questions/627916/iphone-safari-check-if-url-scheme-is-supported-in-javascript
function checkUrlScheme(app_url_scheme, app_install_url, app_name) {
document.location = app_url_scheme;
setTimeout(function() {
if(confirm('You do not seem to have '+app_name+' installed, do you want to go download it now?')){
document.location = app_install_url;
}
}, 300);
}
@zengfenfei
Copy link

What about Android? The android chrome navigates to the next page even if the url scheme is not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment