How to use url scheme for application not installed in device

2.9k views Asked by At

I have an application in store, which allow to display a list of items in a first view, details of an item in the second view.

I use the url schemes to access to the details of an item from an external source (Facebook for exemple)

My question: if the application was not installed in the device, is there any way that allow to download the application and open it at the right item (using url scheme)

Thank in advance

3

There are 3 answers

0
PrasathBabu On

For iOS>9

if ([[UIApplication sharedApplication] openURL:SchemaURL] == false)
{
   [[UIApplication sharedApplication] openURL:iTunesAppURL];
}
0
Sivajee Battina On

First Query that URLScheme and know about the status of the application whether it is installed or not. If it is not installed give him/her a popup to install that application from app store. You can navigate user to app store link when clicks OK from alert.

2
Alex Bauer On

What you're describing is called Deferred Deep Linking (Deep Linking refers to using a link to open your app directly to a specific piece of content, and Deferred means that it works even if the app isn't installed first).

Unfortunately there's no native way to accomplish this on either iOS or Android. URL schemes don't work, because they always fail with an error if the app isn't installed. Apple's newer Universal Links in iOS 9+ get closer in that they at least don't trigger an error if the app isn't installed, but you'd still have to handle redirecting the user from your website to the App Store. You can't pass context through to the app after install with Universal Links, so you wouldn't be able to send the user to the correct item, and they actually aren't supported in a lot of places.

To make this work, you need a remote server to close the loop. You can build this yourself, but you really shouldn't for a lot of reasons, not the least of which being you have more important things to do. A free service like Branch.io (full disclosure: they're so awesome I work with them) or Firebase Dynamic Links can handle all of this for you.