Last active
December 10, 2015 22:48
-
-
Save philsinatra/4504699 to your computer and use it in GitHub Desktop.
iOS check if an app is installed with a fallback event.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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