Skip to content

Instantly share code, notes, and snippets.

@philsinatra
Last active December 10, 2015 22:48
Show Gist options
  • Save philsinatra/4504699 to your computer and use it in GitHub Desktop.
Save philsinatra/4504699 to your computer and use it in GitHub Desktop.
iOS check if an app is installed with a fallback event.
function doesAppExist() {
// try to open iOS application
document.location = 'customiosappurl://';
// if above failed, nothing happened
// set a timeout and do something else
!window.document.webkitHidden && setTimeout(function() {
setTimeout(function() {
window.location = '//apple.itunes.com/whatever'
}, 100);
}, 600);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment