Created
January 2, 2018 21:20
-
-
Save aaustin/6da229a81fc2a6d1ece071b7b489967e to your computer and use it in GitHub Desktop.
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
var fallbackToStore = function() { | |
window.location.replace('market://details?id=com.myapp.package'); | |
}; | |
var openApp = function() { | |
window.location.replace('your_uri_scheme://'); | |
}; | |
var triggerAppOpen = function() { | |
openApp(); | |
setTimeout(fallbackToStore, 250); | |
}; |
This isn't even working on Firefox here [ Firefox android Beta ]. When the app is already installed and the scheme works, it also calls fallbackToStore 250 ms after. In any circumstances, when I launch the website page from the browser or with a link in Slack, etc..
Can we find another way to make it happen without the use of a setTimeout ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any idea, why this isn't working in Chrome, when used with lets say onload event?
Works fine in Firefox and other browsers and also if started through a user click like or .