Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Universal Links sometimes stops working

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?

like image 300
Eyal Avatar asked May 30 '17 08:05

Eyal


People also ask

How do I enable universal links in iOS?

How do I set up Universal Links for my app? Log into your Apple developer account and go to the app's ID page. Enable the Associated Domains app service. Take note of your Prefix (bundle ID) and your ID (team ID) - you will need them later.

Can we test universal link in iOS simulator?

TEST THE UNIVERSAL LINKSRun the application on the simulator once to make sure the application is installed and running fine. 2. Keep the same simulator launched and running. Go to your simulator browser and open type the ngrok domain address i.e., https://1bd39880fbad.ngrok.io in my case.

How do I test universal link?

Start the iOS 10 simulator and run your app. Switch out of the app using multitasking. Open up the Messages app in the simulator. Create a message with the link you want to test and send it.


2 Answers

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):

  • App Search Programming Guide: Universal Links
  • Troubleshooting Universal Links
  • Sailthru's Universal Links: Troubleshooting and FAQ
  • The things I hate (and you should know) about Apple Universal Links
like image 95
Ossir Avatar answered Oct 15 '22 09:10

Ossir


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.

like image 45
Vladimír Slavík Avatar answered Oct 15 '22 08:10

Vladimír Slavík