I will send my clients the link for the app in the following format
http://goo.gl.com/downloadtheapp (or whatever)
I want this file be somewhere on my server that includes java script code that checks what is the device type and redirects to the convenient store. that is, google play if the device was android based and appstore if the device was ios based.
till now I tried this, but it does not work.
<html>
<head>
<script type="text/javascript">
$(document).ready(function ()
{
if(navigator.userAgent.toLowerCase().indexOf("android") > -1)
{
window.location.href = 'http://play.google.com/store/apps/details?id=com.truecaller&hl=en';
}
if(navigator.userAgent.toLowerCase().indexOf("iphone") > -1)
{
window.location.href = 'http://itunes.apple.com/lb/app/truecaller-caller-id-number/id448142450?mt=8';
}
}
</javascript>
</head>
<body>
</body>
</html>
Open Chrome on your Android device. To the right of the address bar, tap More, then tap Settings. Tap Site settings, then select Pop-ups and redirects. Switch Pop-ups and redirects to Block (You should then see “Block sites from showing pop-ups and redirects (recommended)” under Pop-ups and redirects)
Clear the Google Play App Cache Excess data and info stored in the phone can cause your google play store to keep crashing and deleting them might just be the key to solving your issues. To clear the google play app cache do the following: Select settings on your phone. Go to storage.
Just as iOS has its own app store, App Store, Android also has its own market called Google Play.
The problem is with your script tag and you are missing );
And by the way, did you import jQuery?
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script>
$(document).ready(function (){
if(navigator.userAgent.toLowerCase().indexOf("android") > -1){
window.location.href = 'http://play.google.com/store/apps/details?id=com.truecaller&hl=en';
}
if(navigator.userAgent.toLowerCase().indexOf("iphone") > -1){
window.location.href = 'http://itunes.apple.com/lb/app/truecaller-caller-id-number/id448142450?mt=8';
}
});
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With