13

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?

aryaxt
  • 76,198
  • 92
  • 293
  • 442
  • Check this thread: https://stackoverflow.com/questions/32751225/ios-universal-links-are-not-opening-in-app/66353132#66353132 – Sagar Sukode Feb 24 '21 at 14:44

5 Answers5

22

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/

aryaxt
  • 76,198
  • 92
  • 293
  • 442
  • 1
    This here: "/events/*" is the MOST important information ever! – Krumelur May 31 '17 at 15:14
  • 2
    Wow! What you said about the Notes app and Safari's weird logic was really true! My code had been already correct. When I tried Notes, my app started loading every time. It had never loaded before. I hope what you said only applies to the Safari address bar and that links Safari finds on pages will work okay. – Bruce Cichowlas Dec 27 '19 at 11:55
  • 1
    I also was breaking my brain over the safari weird logic issue. Copying my test link to notes did the job. Thanks! – Jaap Weijland Sep 02 '20 at 16:44
  • Also note that "/events/*" won't work for "site.com/events/123123/something", because asterisk only works within a single path component. This was the problem in my case. – algrid Mar 01 '21 at 14:35
9

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!

Nick H
  • 91
  • 1
  • 3
  • 1
    That's quite interesting. What else did you find? – Senõr Ganso Jan 14 '19 at 12:52
  • 1
    Incredibly useful feedback here. On my first try, I actually saw the request succeed. Logs were (some info redacted): `default 17:01:41.239379 -0700 swcd Added service 'applinks', appID 'XXXXXXXX.com.example-sandbox', domain 'www.example-sandbox.com'` – nteissler Mar 15 '19 at 00:04
  • 1
    Also, the remove, reboot, reinstall process was necessary for this to finally work: https://blog.branch.io/notice-inconsistent-universal-link-behavior-on-ios-11-2/ – nteissler Mar 15 '19 at 00:06
  • 1
    This was written about a year ago. I'm trying to get it to work now. Can it really be that flaky? Maybe I'm doing everything right and it still isn't working simply because I haven't tried enough times. – Bruce Cichowlas Dec 27 '19 at 05:08
  • 1
    I got below error when install the application (iPhone 7 plus, iOS 13.3.1) Error getting enterprise-managed associated domains data. If this device is not enterprise-managed, this is normal: Error Domain=SWCErrorDomain Code=1701 "Failed to get associated domain data from ManagedConfiguration framework." UserInfo={NSDebugDescription=Failed to get associated domain data from ManagedConfiguration framework., Line=250, Function=} Do you have any idea to resolve this issue? – Pramuka Dias Jun 18 '20 at 05:31
4

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!

joshweir
  • 5,427
  • 3
  • 39
  • 59
3

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.

Alex Bauer
  • 13,147
  • 1
  • 27
  • 44
  • 1
    no the app doesn't open and delegate methods are not called, been stuck on this for 2 weeks :( gone through that troubleshooting guide already – aryaxt Dec 01 '16 at 02:07
1

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.

Lukas
  • 1,346
  • 7
  • 24
  • 49