We have an update and a probable cause, and this ended up being much more interesting than expected!
TL;DR: passing link data as a query string parameters works for both app.link
and test-app.link
. The real cause behind these symptoms is something else, but would never be encountered by a normal user.
Symptoms
Link parameters appended to an existing Branch link (for example: https://bnpo.app.link/identifier?foo=bar) do not reliably show up inside the app.
Cause
It turns out that at some point, Apple changed the behavior of mobile Safari so that when you enter a URL that is also in your history, Safari actually preloads the page as you type. To the Branch servers, this looks exactly the same a regular visit, so we create device fingerprints for each one of these 'visits'. You can actually see this in action by going to the Link Clicks page on your Branch dashboard, entering the URL for a Branch that you have visited before into the Safari address bar, and then watching all the link 'clicks' roll in.
The problem is the Branch SDK consumes device fingerprints sequentially from oldest to newest. If you have previously visited https://bnpo.app.link/identifier
while testing, and then re-enter that URL with an appended query parameter (https://bnpo.app.link/identifier?foo=bar
), Safari has already loaded https://bnpo.app.link/identifier
before you even have a chance to type in ?foo=bar
.
This means your device now has two different fingerprints outstanding:
- One for
https://bnpo.app.link/identifier
- Another for
https://bnpo.app.link/identifier?foo=bar
Even though you press Go to trigger the launch of the app with the URL https://bnpo.app.link/identifier?foo=bar
, the fingerprint for https://bnpo.app.link/identifier
already exists, and is consumed first within the app because it is a older (by a second or two, depending on how fast you type).
If you then exit the app and launch it again immediately, you'll get the next fingerprint with the extra parameter.
Solution
This is a situation that would come up fairly easily during testing, but that real-life users are almost never going to encounter. It only occurs when manually typing in a URL that has already been visited, and then appending additional query parameters to it.
For testing purposes, simply relaunch your app repeatedly until you get no data (+clicked_branch_link: 0
) from the Branch init()
call during launch (to use up any outstanding fingerprints), and then either...
- Type out your URL in full using Notes and paste it into Safari
- Just open the URL from inside Notes
We'll add a cautionary note summarizing the above in our documentation. Thanks for bringing it to our attention!