Skip to content

Instantly share code, notes, and snippets.

@aaustin
Created January 2, 2018 21:20
Show Gist options
  • Save aaustin/6da229a81fc2a6d1ece071b7b489967e to your computer and use it in GitHub Desktop.
Save aaustin/6da229a81fc2a6d1ece071b7b489967e to your computer and use it in GitHub Desktop.
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);
};
@mho22
Copy link

mho22 commented Mar 9, 2018

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