Created
July 1, 2014 16:45
-
-
Save brennanMKE/ce933fd871775bdb79f2 to your computer and use it in GitHub Desktop.
Website to App Redirect
This file contains hidden or 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
<html><head><title>MyApp Redirect</title></head> | |
<script type="text/javascript"> | |
var isAndroid = /Android/i.test(navigator.userAgent); | |
var isiOS = /iPhone|iPad|iPod/i.test(navigator.userAgent); | |
if (isiOS) { | |
location.href = "https://itunes.apple.com/us/app/myapp/id99999999?mt=8"; | |
} | |
else if (isAndroid) { | |
location.href = "https://play.google.com/store/apps/details?id=com.myapp.myapp"; | |
} | |
else { | |
location.href = "http://www.myapp.com/"; | |
} | |
</script> | |
<body> | |
<a href="http://www.myapp.com/">MyApp</a> | |
</body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment