1
votes

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?

1
Can't you check if you can open the URL on your web app and then redirect based on the result.Vig

1 Answers

1
votes

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";
    }