Skip to content

Instantly share code, notes, and snippets.

@onlyyoujack
Forked from philsinatra/iOS-app-exists-check
Created May 16, 2013 09:23
Show Gist options
  • Save onlyyoujack/5590541 to your computer and use it in GitHub Desktop.
Save onlyyoujack/5590541 to your computer and use it in GitHub Desktop.
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