iOS Universal Links sometimes stops working
Asked Answered
T

2

8

My app supports universal linking and in most cases it works without any issues, tapping on a link opens the app like it should.

But sometimes, i'm not sure why, it stops working.

It happened a few times to one of the users, tapping on the link stopped opening the app and instead it opens the web.
And from that moment there is nothing you can do to make it work again.

I know that if you tap on the link in the top right corner on the status bar, it disables the universal linking and from that moment tapping on a link will open the web. and to re-anable universal linking you can tap the link on Notes App(for example) and tap the "Open in MyApp" button.

But this doesn't seems like the case, the user told me he is not pressing the link on the status bar, and even more weird, when trying to re enable the universal linking by tapping the link in Notes App, the "Open in MyApp" button is missing.

Any ideas what could cause this issue?

Talkingto answered 30/5, 2017 at 8:36 Comment(1)
I apologize, due to lack of reputation, I am leaving a comment here. Mine stopped working one day although apple-app-site-association seemed still valid. Then I found that when I long-clicked a web link, it gave me options to choose from, where I found "Open in 'MY APP'".Alcaic
P
19

Based on my previous experience it could happen for various of reasons:

  • Most likely: apple-app-site-association is not available for user or is available with insecure connection. Here are possible origins of such problem, I am sure there are others as well:
    • User does not have internet or connection to your site/apple-app-site-association file on your site. Even though it should redirect to your app, Universal links feature needs to check existence of this file on site. It's done first time at app installation and each time you open your link (I checked on iOS10.3 with Charles). Note, that it does not wait the check to be completed and shows or does not show "Open in MyApp" button based on previous check. Even if user has internet on, your site could be blocked by firewall or something.
    • User has access to apple-app-site-association file, but he access it from a network or via a proxy that requires you to accept some certificate in order to decrypt your HTTPS access. Hence your HTTPS traffic became insecure. iOS checks that and fails validation of apple-app-site-association file.
    • User has access to apple-app-site-association file with good secure connection now, but previous access failed because of previous reasons -> user won't see your app opened this time or "Open in MyApp" button in context menu for reasons I described before. How to fix that? No idea, just try couple of times all the time.
  • You already declined that option, but just for future readers. If user taps on top right button with site name - all future transitions will redirect user to Safari instead of your app, until user tap this button again. Basically, iOS saves last user choice.

There are a lot of other reasons for that to not work, but in those cases there will be some 100% specific steps to reproduce, like does not work for certain /path or for debug/release candidates or for test server. It seems that is not your case so I won't cover it here.

Helpful links (quite a lot of repetition, but if you stuck, it's worth to repeat it):

Philology answered 30/5, 2017 at 9:10 Comment(3)
thanks for your answer, i dont think its a network/internet issue, because once it happens it wont work on any network. maybe thats fit the third option you mentioned, are you sure that thats right? if one of the previous access failed then any future access will fail as well?Talkingto
@Talkingto It will fail only one next attempt. The reason for that, iOS does not wait till apple-app-site-association check finished (remember, it's async operation) and shows result immediately, hence this result is based on last check.Philology
I'd just like to add another scenario which wasted my 2 days trying to debug. If the device's date/time is wrong, the SSL cert failed to authenticate in my case and the universal links weren't working. As soon as fixed date/time, it started working without any problems :-/Softhearted
K
1

To me it happens the association file is sometimes not downloaded upon the app's installation even when the device can access the file from Safari.

Kitchenmaid answered 6/11, 2018 at 10:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.