49

Similar to this question: How to make ios App Store link with parameters?

I am interested in passing parameters to the download link in the iOS app store. From what I've read, it seems that the parameters are only passed to the application if it was already installed, and the user tapped the smart app banner.

What I want to do is pass parameters to the download link such that when a user downloads, the first time they open the app, the parameters will be passed.

Mainly, I want to allow users to invite their friends to play my app through email or facebook and when the friend downloads using their link, it will send a push to the original player to notify that their friend now has the app.

Thanks!

Community
  • 1
  • 1
Evan Layman
  • 3,691
  • 9
  • 31
  • 48

4 Answers4

48

This is now easier with the coming iOS 9, because cookies can be shared between Safari and the in-app Safari View Controller! Simply keep a cookie in the browser and track the last link clicked on. Then when the user opens your app, open up an invisible Safari View Controller in the background while you show a spinner. As soon as you can inspect the cookie and see the last link clicked, you can stop the spinner--it should be a very fast operation.

We offer this for no cost at Branch, where we've had a customizable web banner for some time. Now we're excited to incorporate the Safari View Controller into our open-source SDK! We also have a version of digital fingerprinting that allows you to do the same on pre-iOS 9 devices. We use IP address, OS, OS version and more to compare a click in a browser to an open in an app. This approach has pros and cons.. happy to go into further detail if you're interested.

st.derrick
  • 4,769
  • 2
  • 24
  • 25
  • 2
    I saw Branch on Product Hunt and was curious about how you were doing the linking of post-install data so I started googling around. Thanks for the insight here. Do you have any data on how often this leads to false-positive identification of users after download? Also, do you put a time limit on recognizing a user after they click the initial download link? – markquezada Aug 15 '15 at 09:55
  • 2
    We discuss matching in-depth here: https://dev.branch.io/recipes/matching_accuracy/ -- collisions are most likely at large events where everyone is on the same wifi and if we've never seen the devices before (and we've seen hundreds of millions of devices). We use 2 hours as the default time limit, but this is completely customizable on both an app-wide and per-link basis. See 'duration' on the page referenced above. – st.derrick Aug 17 '15 at 20:32
  • What appen if I use another browser? does it work only if you start from a link in safari browser? – Paolo Biavati Oct 21 '15 at 14:39
  • Then you should use digital fingerprinting, as cookies will not be shared unless that other browser is actually an SFSafariViewController – st.derrick Oct 22 '15 at 17:03
  • 1
    is this allowed by ? Isn't there the risk of getting rejected when showing an invisible Safari View Controller? – swalkner Feb 07 '17 at 14:06
  • Can that work if the link is opened from another app that uses a UIWebView, like Messenger? – Guig May 16 '17 at 00:52
  • 5
    @swalkner it's not allowed since AppStore guidelines were updated. Now, according to **5.1.1(iv)** of the [App Store Review Guidelines](https://developer.apple.com/app-store/review/guidelines/#data-collection-and-storage) _"SafariViewContoller must be used to visibly present information to users; the controller may not be hidden or obscured by other views or layers."_ – Liubo Jun 08 '17 at 12:14
  • 13
    is this still relevant? what's the 2020 approach to this if any? – Return-1 Jan 03 '20 at 05:20
  • 1
    @Return-1 did you find any solution? – lqsdwtxkzlqafpvluq Dec 07 '20 at 09:23
  • 1
    Does this work for Chrome and Firefox and other mobile browsers? – ina Aug 11 '21 at 22:37
0

See a solution at: How to make ios App Store link with parameters?

Essentially this post tells you that you can pass a url parameter to the iOS App Store for iOS 6.0 and later using smart banners (http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html), and this parameter will be passed on to your app and received in the application:openURL:sourceApplication:annotation: method in your app delegate (which you must implement).

Community
  • 1
  • 1
user2096580
  • 413
  • 1
  • 5
  • 10
  • 2
    This doesn't answer the question. The app-argument will only be passed to the app if the app is already installed, like the OP says. – user102008 Aug 15 '13 at 01:49
0

You can pass a parameter to the app via Smart App Banner once the app is installed.

So I suggest providing one link to install the app, then a second link to a page with a Smart App Banner to pass the parameter.

This is a kluge, but it's the only way to do it in iOS. (iTunes store is a black box, whereas Play store passes Android params).

Fred
  • 11
  • AFAIK, you can only pass contextual data if the app is installed, so this is wrong: `If you include this, and the user has your app installed, she can jump from your website to the corresponding position in your iOS app.` – Michael Sep 14 '15 at 16:58
  • does this still apply in 2021 – ina Aug 11 '21 at 22:39
-4

Now with iOS8, you can pass provider id and campaign id into the app store link as parameters: http://www.applift.com/blog/new-era-attribution-analytics.html

greegles
  • 425
  • 5
  • 11