ios-branch-deep-linking-attribution icon indicating copy to clipboard operation
ios-branch-deep-linking-attribution copied to clipboard

Sometimes universal links don't work on iOS 11.2 and above.

Open E-B-Smith opened this issue 6 years ago • 16 comments

Sometimes universal links don't work on iOS 11.2 for newly installed apps

Here's the Branch blog post about this.

The symptoms are that clicking on a universal link won't open an app that is newly installed on a phone. The universal link takes the user to a web page and is prompted to download the app again.

Through testing here at Branch HQ we've discovered that the Apple App Site Associated Domains file (apple-app-site-association file) isn't always downloaded after the app is installed, either when it's installed from the app store or from Xcode.

Removing the app, restarting the phone, re-installing the app, and waiting a minute or so seems to clear this up. This is a horrible user experience obviously.

We are filing a radar with Apple and will continue to track this issue.

http://www.openradar.me/radar?id=4999496467480576

Mitigations

Set $uri_redirect_mode

Setting the $uri_redirect_mode option on links can have Branch try to force the link to open the app, even if it might show an error to the user. You can read about this option here, in the Branch docs.

Here's more info about turning on $uri_redirect_mode in your Branch Journey or Deepview banner, the web snippet that Branch shows the user if the ends up deep linking into a web browser:

Advanced Journey Configuration

Deferred Deep Linking Also Mitigates This Problem

This issue is mitigated by Branch's deferred deep linking tech: If the user opens the app from their home screen after the universal link is clicked, deferred deep linking still works, and the link content is shown in the app (Thanks Branch!).

E-B-Smith avatar Dec 14 '17 19:12 E-B-Smith

@E-B-Smith would setting $uri_redirect_mode on the link be the same as setting "URI Scheme Redirect Mode" via the Link Settings dashboard?

image

We see this failure a lot, but "Deferred Deep Linking" has always seemed to work. Recently, we've had a few user reports where the links never work, even with "deferred deep linking". They get sent to the app store, then open the app and don't see the link content. This is only for a few users, most people have success even with the "deferred deep linking".

Are there known issues with "Deferred Deep Linking"? We are running 0.24.2, maybe something has been fixed as of 0.25.9?

bcherry avatar Nov 30 '18 19:11 bcherry

I would upgrade to the latest version of the Branch iOS SDK which fixes some issues that Apple introduced in iOS 12 that will prevent deep links from opening sometimes.

The dashboard setting for 'URI Scheme Deep Link Mode' in the dashboard is the default for the app and setting $uri_redirect_mode mode for a link will override that.

E-B-Smith avatar Dec 01 '18 00:12 E-B-Smith

@E-B-Smith is there a reason you recommend setting $uri_redirect_mode on all your links instead of just changing the dashboard setting?

bcherry avatar Dec 01 '18 00:12 bcherry

I personally would change the dashboard setting. There's a chance that an error alert box would pop up for some users that don't have the app, and some people really don't like that experience.

But I think not being deep linked is a worse experience. But that's me.

It's entirely up to you. The documentation tends to be conservative on this.

E-B-Smith avatar Dec 01 '18 00:12 E-B-Smith

Thanks!

bcherry avatar Dec 01 '18 00:12 bcherry

@bcherry Are you still experiencing this issue? If so, we would be happy to discuss it further with you. If not, we will close this issue.

csalmi-branch avatar Dec 29 '18 00:12 csalmi-branch

@csalmi-branch no, we don't have this problem anymore after switching the setting to "aggressive". However, changing this setting did break our links in a different way as we had them wrapped in third-party click-tracking but branch would no longer handle many app opens via URI scheme after this change. We've temporarily disabled click-tracking on our emails for the holidays so users have a good experience, and plan to re-evaluate deep linking platforms in January.

bcherry avatar Dec 29 '18 02:12 bcherry

@bcherry I am sorry to hear that the setting change still isn't allowing you to do deeplinking how you would like. I have backlogged a ticket for our team to re-evaluate this situation and see if we can come up with a better solution for you.

csalmi-branch avatar Jan 03 '19 19:01 csalmi-branch

I am seeing something similar but slightly different. Wondering if it's related or if I should create a new issue...

This scenario works as expected:

  1. App is uninstalled
  2. User clicks branch deep link, which opens up a web page and prompts them to head to the app store to install
  3. Upon opening the app, data is passed through the deep link properly. All is good!

This scenario DOES NOT work as expected:

  1. App is already installed
  2. User clicks on the branch deep ilnk
  3. The app is properly opened directly...no intermediary web page...this is expected and correct.
  4. But NO DATA is passed through when opening this way.

It seems like I only can access data parameters that I'm passing through the link when it's "fingerprinted" in the safari browser? I switched my link mode to "Aggressive" via the dashboard and it didn't change anything.

Not sure if it's related, but I'm also getting an "Error" on the web page that says "Safari cannot open the page because the address is invalid." When I click OK it brings up the expected "Open this page in "App Store"? and things work properly from there.

Any ideas?

dannyfreed avatar Jan 30 '19 17:01 dannyfreed

@dannyfreed exactly the same problem occurred since two weeks in my implementation. The app is already in the App Store and there it works well, but in the coming release candidate it doesn't work anymore (installed via TestFlight).

Edit: found the solution in another solved issue: In the current version I update Swift and there the signature of an method in app delegate have changed. https://github.com/BranchMetrics/ios-branch-deep-linking/issues/869#issuecomment-427280133

alexanderkorus avatar Feb 07 '19 13:02 alexanderkorus

@E-B-Smith sorry if this is a stupid question, but is there something I have to do to explicitly enable Deferred Deep Linking? Or is that just baked into the Branch tech? I couldn't find much on this topic 😞

Also, does anyone know if there's been any movement on this front in the last four months?

myster-t avatar Jun 04 '19 16:06 myster-t

The deferred deep linking is turned on by default.

Chat with @echo-branch at Branch. He knows the latest status of this issue!

E-B-Smith avatar Jun 04 '19 17:06 E-B-Smith

@echo-branch @E-B-Smith hi, is there any update about these issues now?

I ask because I'm facing a requirement for using deeplinking within our app but the business logic makes it a bit mission critical, so if it's unreliable then I have to find another way to achieve the result.

But if this issue is fixed and we can get reliable deeplinking on iOS then I'll stick to using the branch links for this. Last update I see is from June 5th last year so hopefully this has been solved since?

florianmonfort avatar May 19 '20 07:05 florianmonfort

@florianmonfort I have not seen this issue since iOS 12.

The issue was independent of Branch. Some iOS 11.2 devices failed to download the apple-app-site-association file, which is normally fetched at app install.

echo-branch avatar May 19 '20 19:05 echo-branch

Still getting the same issue

I am seeing something similar but slightly different. Wondering if it's related or if I should create a new issue...

This scenario works as expected:

  1. App is uninstalled
  2. User clicks branch deep link, which opens up a web page and prompts them to head to the app store to install
  3. Upon opening the app, data is passed through the deep link properly. All is good!

This scenario DOES NOT work as expected:

  1. App is already installed
  2. User clicks on the branch deep ilnk
  3. The app is properly opened directly...no intermediary web page...this is expected and correct.
  4. But NO DATA is passed through when opening this way.

It seems like I only can access data parameters that I'm passing through the link when it's "fingerprinted" in the safari browser? I switched my link mode to "Aggressive" via the dashboard and it didn't change anything.

Not sure if it's related, but I'm also getting an "Error" on the web page that says "Safari cannot open the page because the address is invalid." When I click OK it brings up the expected "Open this page in "App Store"? and things work properly from there.

Any ideas?

I am getting exactly the same issue

isaacCLC avatar May 11 '21 13:05 isaacCLC

@isaacCLC I suspect you're seeing a different issue, as I haven't seem the failure to download the app association file in quite some time.

The Branch SDK has several methods that require init to complete before calling them. If you call them before init, we will auto-init in order to fulfill the request and log a warning. The side effect of auto-init is that we don't actually know where to callback to until the app calls init. This leads to missing callbacks.

Here's an example of an API that requires init to complete. https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/blob/master/Branch-SDK/Branch.h#L1400-L1409

You can check if this is the root cause by enabling logging and looking for an error message indicating Branch initialized automatically.

echo-branch avatar May 11 '21 17:05 echo-branch