13
votes

I'm having trouble getting universal links to work

running the apple validation fails with the following error: Error no apps associated with url

I thought maybe the validator doesn't work, but running on iOS 10 device (universal link capability on, with added correct domain to it) clicking a valid link does not trigger the delegate methods in AppDelegate

Any thoughts?

5

5 Answers

22
votes

After 3 weeks... It turned out my path was incorrect. My suggestion:

set paths to ["*", "/"] while debugging, get everything to work and test, then as the final step update the path and only include supported paths.

To be more specific the link I was trying to register was site.com/events/123123 so I would add a path for /events which is wrong that would register site.com/events. I had to register /events/* instead

Also the easiest way to test it is to enter the expected links into the Notes app, because Safari has some weird logic on when links should be handled as deeplink.

Apple's app-site-association validator is useless, it's still failing for me complaining about my App id, when deeplinks actually work. Instead use https://limitless-sierra-4673.herokuapp.com/

9
votes

I've recently had issues debugging the Universal Link functionality of my app. I was able to get deep linking to work but it seemed to only work 10% of the time. Since I had just updated to iOS 12, I wanted to make sure there was nothing else I had to do as a developer to ensure the feature worked.

So what was causing intermittent failure? It seems that iOS has a somewhat strict policy engine for determining when background threads can run. I was able to observe this by USB tethering to my phone and opening up the debug console for my device

  • Xcode –> Windows –> Devices & Simulators
  • Click on device in the left pane
  • Click Open Console

From there, I was able to filter on "swcd" (SharedWebCredential Daemon). Keeping this console open, I was able to see the daemon at work during app install which is when iOS attempts to pull down the apple-app-site-association file for my app.

As it turns out, dasd (DuetActivitySchedulerDaemon) was failing to run the SharedWebCredential Daemon because my phone had restarted recently, then later it was determined that my phone was too hot...

e.g.

{name: ThunderingHerdPolicy, policyWeight: 1.000, response: {Decision: Must Not Proceed, Score: 0.00, Rationale: [{deviceInUse == 1 AND timeSinceThunderingHerdTriggerEvent < 900}]}}
 ], FinalDecision: Must Not Proceed}

{name: ThermalPolicy, policyWeight: 5.000, response: {Decision: Absolutely Must Not Proceed, Score: 0.00, Rationale: [{thermalLevel >= 20}]}}
 ], FinalDecision: Absolutely Must Not Proceed}

Developers beware!

3
votes

The Apple validator checks some other things that are not necessary for Universal Links to work, and unfortunately that often results on false positive error messages. The file at https://couchsurfing.com/apple-app-site-association looks good to me, and it passes this validator just fine.

When clicking on a valid link, does the app not open, or just the delegate methods don't fire? These are two very different issues and would have different solutions. There are some troubleshooting steps you could try here, though some of those are specific to the Branch.io (full disclosure: I'm on the Branch team) linking platform.

3
votes

I step through Apple's troubleshooting universal links procedure as already mentioned in other answers.

If still not working, and long-pressing the link in mail or notes app fails to show "Open with [your app]" then try restarting your phone. More than a few times this has been the solution for me!

1
votes

As some sort of completion to the answers above (took me hours to find out):

The app needs to be installed AFTER you added your "apple-app-site-association" file to the server, as the file initially got fetched / checked after the installation.