Deferred Deep Linking in iOS

Deferred Deep Linking in iOS

We have also attempted to do this ourselves and I will try to break down the different steps here.

Going back to your example, you are correct about "remembering" the device identification, and all relevant data "id=userA". You are also correct about "sandboxed nature of iOS" which I presume it means a web page is not allowed to store information outside of the browser app (Safari) and apps (your app) are not able to access information stored by other apps (Safari).

Our solution to this is to store this device to data key-value pair in an environment that is both accessible by the browser as well as by your app, i.e. your backend server.

The next challenge, which remains to be the biggest challenge, is how to uniquely identify this device from the information collectable from the browser? Javascripts in browsers, unlike native apps, don't have access to IDFAs which could be used to uniquely identify a iOS device. To overcome this, one can imagine to use a combination of common information that is available both to the browser app as well to your native app, i.e. OS type, public IP, screen size, etc. etc. Please note, a composite key from these data fields does not guarantee uniqueness (imagine two iPhone 6 visiting this web page via the same router). Therefore, your backend server (assuming you are using it to store this key-value pair), will want to have a strategy on how to handle collisions on keys i.e. the second key deletes the first key, or you allow collision to exist by having a queue of values for a single key. This really depends on how you actual plan to use this technology.

The last step is to form this composite key on your app using the exact same fields you used earlier in the browser to perform a "lookup" on your backend server to retrieve the value previously stored.

Here is a summary of the steps:

  1. User 1 invites User 2 by sending the following link to 2: example.com?inviter=1
  2. User 2 visit Web Page P
  3. P constructs and sends the following key-value pair to your server S iOS|55.55.55.55|750×1334 -> inviter_id=1
  4. User 2 goes to the app store and downloads your App A
  5. User 2 first launches A, A contacts S with the same key (assuming the IP hasn't changed).
  6. S finds the value inviter_id=1 by using this key passed in and, let's say, reward User 1 five points for inviting 2.

Hope this help!

Edit 04/24:

Since Derrick mentioned it in the comments, I figure I would take this chance to finish our story here.

Going back to the beginning of my answer where I mentioned we've attempted to do this ourselves. We had a working prototype based on our current system architecture (which is not in anyway optimized, or meant to be optimized, for storing and analyzing deep link data like this), we ultimately decided not to allocate any additional engineering resource into this project.

Due to the heuristic nature of this matching process, we found this project needing debugging, tuning and optimizing constantly for a diminishing ROI. More importantly, we have found other companies which are more specialized and do a much better job than ourselves.

It has been probably 6 months since we stopped using our internal system and we haven't regretted making such decision.

During this processes, we've worked with a number of vendors, Appsflyer, Adjust, TapStream and we have ultimately ended up with Branch Metrics https://branch.io.

Whether you should DIY or work with another company again depends on your specific objective. We finally decided to stay with Branch, not only because the other vendors charged anywhere from $500 to thousands of dollars per month while Branch is completely free, but also the level of the support they have provided is simply unparalleled.

How to test your deferred deep link in iOS

According to Branch.io, which we use a lot, you can manually replicate the process without the App Store. When they say "Branch link" just use your own link:

Deferred deep linking is simply deep linking into an app that is not
yet installed. Once the app is installed, the context is preserved and
the user's first app-open will have the deep link data from the
original Branch link. To test this, uninstall the app from your
device, click the Branch link, and manually launch the app from Xcode.
You should be routed to the correct content within your app.

https://help.branch.io/developers-hub/docs/ios-testing

iOS - Test getting Facebook deferred deep link

You should specify add account id in the FB App Advanced setting.

If you have free developer account - remove push notifications from your Xcode project.

Then on your physical device you should install Facebook app and login into account from which you've registered your app.

Plug in your device.

Send deferred deeplink via FB testing tool (Mark both checkboxes).

Run your app from Xcode on your physical device. For app to launch you show trust it from your phone Settings -> General -> Device Management -> Developer App -> Trust.

Now your app should run, you should get deferred deeplink and green checkmark near the third option on the first photo should appear.



Related Topics



Leave a reply



Submit