Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS universal links not working?

I'm having trouble getting universal links to work

  • We have added the json content to our site https://couchsurfing.com/apple-app-site-association
  • I have double checked that it's using the correct team ID and bundle ID
  • Universal links is enabled in itunesConnect

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?

like image 431
aryaxt Avatar asked Nov 22 '16 23:11

aryaxt


4 Answers

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!

like image 61
joshweir Avatar answered Oct 27 '22 11:10

joshweir


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/

like image 25
aryaxt Avatar answered Oct 27 '22 10:10

aryaxt


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!

like image 9
Nick H Avatar answered Oct 27 '22 11:10

Nick H


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.

like image 3
Alex Bauer Avatar answered Oct 27 '22 09:10

Alex Bauer