3

Not really sure how to correctly describe this so hopefully some of you know what I mean.

Our client is getting a mobile app for thier site, hopefully soon, and I have noticed on android devices and sure they probably exist on iphones too, a popup to inform you that said site has an app. I have seen it on forums that support tapatalk as well as the sammobile.com website. Its a small message and an "ok" and "cancel" button, ok takes you to the app in the market.

Googles only really helpful when you know or at least can correctly describe what you are looking for.

Does anyone know A) Do iPhones also have this feature and B) how would I go about triggering such a popup/notification?

RemeJuan
  • 823
  • 9
  • 25

1 Answers1

5

Using some infor from a java push trigger as well as a few other Stacks I put this together.

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 = 'http://www.google.com';
    url.show();
  }
}

Will test for the 3 devices mentioned, if so will create a confirmation box for which confirmation will direct the user to another url.

Ruben Helsloot
  • 12,582
  • 6
  • 26
  • 49
RemeJuan
  • 823
  • 9
  • 25