1

So, we've all pretty much seen it. I tap a google plus link in Safari and it opens in the native Google Plus app. If the app is not installed, it takes me to the store to download it. It's a seamless transition.

As a developer, I would like this type of integration with my web application and native application. I've seen a way to call the native app using a custom url scheme, but this throws a nasty alert if the app isn't on the device.

I thought that the way around it might be creating a Safari extension, but that's not do-able with mobile safari.

How can I achieve this seamless transition effect?

Ben Reed
  • 824
  • 1
  • 8
  • 26
  • Can't you check if you can open the URL on your web app and then redirect based on the result. – Vig Nov 12 '14 at 18:36

1 Answers1

1

This answer might help you to determine whether the app was installed or not from web app.

iPhone browser: Checking if iPhone app is installed from browser

If it's not installed you can continue redirecting to your web app instead of myapp://

The code from one of our web apps

var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
var messageContainer=$("#message");

    if(!iOS)
    {
        messageContainer.html("Please open the link in your Apple mobile device")
    }
    else
    {
        setTimeout(function () { 
          messageContainer.html("Please install the app");}, 25);
         window.location.href = "myapp://someInfo";
    }
Community
  • 1
  • 1
Vig
  • 1,532
  • 1
  • 12
  • 28