) We have in app for android and iphone. When someone visits are website using their mobile phone, we want i popup that says.. Hi we have an app, want to download it? or whatever ;-) When selected yes, it has to download the app.
But i only want the popup to display when the app is not yet installed... So far i found this code.. As you can see, this wont work.. If anyone could help me out! Would be great!
<script type="text/javascript">
if( /Android|iPhone|BlackBerry/i.test(navigator.userAgent) ) {
var url=confirm("Would you like to download our mobile application?");
if (url==true)
{
var url = window.location.href = '? id=.appmachine.p9890BH';
url.show();
}
else
{
}
}
</script>
) We have in app for android and iphone. When someone visits are website using their mobile phone, we want i popup that says.. Hi we have an app, want to download it? or whatever ;-) When selected yes, it has to download the app.
But i only want the popup to display when the app is not yet installed... So far i found this code.. As you can see, this wont work.. If anyone could help me out! Would be great!
<script type="text/javascript">
if( /Android|iPhone|BlackBerry/i.test(navigator.userAgent) ) {
var url=confirm("Would you like to download our mobile application?");
if (url==true)
{
var url = window.location.href = 'https://play.google./store/apps/details? id=.appmachine.p9890BH';
url.show();
}
else
{
}
}
</script>
Share
Improve this question
asked Jan 3, 2014 at 15:28
GiancarloGiancarlo
311 silver badge3 bronze badges
2
- You want a web page to be able to read what apps a user has installed? Really? Do you think this might be a security/privacy problem? I don't know iOS, but on Android, this is not possible. – Simon Commented Jan 3, 2014 at 15:36
- Hi Simon, thanks for that insight. If that is a problem, we need the code without that bit. So only if android, it should show download popup for play store, and for iphone a dwonload for itunes. – Giancarlo Commented Jan 3, 2014 at 15:43
1 Answer
Reset to default 4For the iPhone, promoting your app while checking for its existence is possible with Apple's smart app banner, here are the docs.
This is limited to Apple and Safari, but it's a good starting spot.
Otherwise, I used this library and it has worked pretty well out of the box for me so far..