How do I redirect to the Apple App Store with a deep link? (e.g. a query string)

halfbit picture halfbit · Oct 6, 2015 · Viewed 15.7k times · Source

I need to have an iOS user, who doesn't have my app installed, to download, then automatically navigate to a portion within my app.

Related, is this question, but I am not exclusively reliant on Google's SDK. I can use anything.

How can I

  • Link a user to my app on the app store AND
  • Have information (a query string) sent to my app on first launch

Answer

dstudeba picture dstudeba · Oct 6, 2015

With deeplinks you have a link that is passed to the App whether it is installed or not. There are a lot of posts out there about setting them up but here is a quick overview.

First you need to configure your App to handle them in the .plist file. Here is a post for that:

https://blog.branch.io/how-to-setup-universal-links-to-deep-link-on-apple-ios-9

You can either use a tool like branch.io or set up a redirection page on your own website with an SSL certificate since it requires https. (there is information in the link above, or here is some information from Apple)

When your App is called by the deeplink (whether it is installed or not) the - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation method is called in AppDelegate.m and the information you are passing is in the url parameter.

Here is a good post about setting them up.

http://blog.originate.com/blog/2014/04/22/deeplinking-in-ios/