Skip to content

Instantly share code, notes, and snippets.

@lawreyios
Created June 23, 2021 11:11
Show Gist options
  • Save lawreyios/ec76d4293dc176b308d2dd957396c34c to your computer and use it in GitHub Desktop.
Save lawreyios/ec76d4293dc176b308d2dd957396c34c to your computer and use it in GitHub Desktop.
<script>
var redirectToApp = function () {
setTimeout(function appNotInstalled() {
window.location.replace("[Somewhere else like your youtube ad]");
}, 100);
window.location.replace("[iOS App Store URL]");
}; if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
window.location.replace("[iOS App Store URL]");
} else if (/android/i.test(navigator.userAgent)) {
window.location.replace("[Android Play Store URL]");
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment