Created
June 15, 2020 23:36
-
-
Save juniorthiesen/d2a8162e3a51b25dd2f8cf2ba921c018 to your computer and use it in GitHub Desktop.
Deep Link Instagram
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
var destination = "instagram://user?username={USERNAME}"; | |
if( navigator.userAgent.match(/Android/i) ) { | |
// use Android's redirect | |
document.location = destination; | |
} | |
else { | |
// use iOS redirect | |
window.location.replace( destination ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment