Last active
September 23, 2015 17:38
-
-
Save robcolburn/b8b20a00c7e2ca9ce5f5 to your computer and use it in GitHub Desktop.
1. Apple added prompts to every interaction with app links. 2. Apple also introduced to prevent js-circular redirects (every time you re-open safari it tries to re-open that app).
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
<!doctype html> | |
<html> | |
<head></head> | |
<body> | |
<script> | |
function sendThemAlong(){ | |
var href = location.href; | |
if (!href.match("store_redirect=true")) { | |
var done = false; | |
function gotoStore() { | |
if (!done) { | |
try { | |
// Can't send them to Store App | |
// window.location = "itmss://itunes.apple.com/us/app/nbc-watch-live-tv-now-stream/id442839435?mt=8" | |
// Redirect them back around, so that we can send them to store app | |
window.location = href + (href.match(/\?/) ? "&" : "?") + "store_redirect=true"; | |
done = true; | |
} catch(e) { | |
setTimeout(gotoStore, 1000); | |
} | |
} | |
} | |
setTimeout(gotoStore, 1*1000); | |
window.location = "nbctve://?" | |
} | |
// Ok, they came back around, now send them to store app. | |
else { | |
window.location = "itmss://itunes.apple.com/us/app/nbc-watch-live-tv-now-stream/id442839435?mt=8" | |
} | |
} | |
sendThemAlong(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment