Skip to content

Instantly share code, notes, and snippets.

@aaustin
Created January 2, 2018 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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);
};
@nzkozar
Copy link

nzkozar commented Jan 17, 2018

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 .

@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