Universal Link is not working on properly on iOS 13 (AASA not downloaded)

TKP picture TKP · Sep 26, 2019 · Viewed 7.1k times · Source

Universal Link was working fine on iOS 12 but I ran into issues when I updated to iOS 13.1 yesterday. URLs that's supposed to open the app when tapped are just opening up in the browser. Some users on iOS 13 reported the same thing.

Again, I never had this issue on iOS 12.4

I believe AASA file is not being downloaded properly. I tried tapping on Open from the banner that appears on top of Safari when I land on one of my urls. This didn't help.

Sometimes it worked fine after few re-installs and reboots but when you re-install again it stops working.

I found this blog post https://ios13.dev/universal-links-debugging-on-ios-13-cjwsux93w001p6ws1swtstmzc which describes viewing of the logs.

I exported sysdiagnose and my swcutil_show.txt shows this for my app

Service:              applinks
App ID:               (my app ID)
App Version:          102
Domain:               (app.myurl.com)
User Approval:        unspecified
Site/Fmwk Approval:   unspecified
Flags:                
Last Checked:         2019-09-26 00:48:24 +0000
Next Check:           2019-09-30 23:51:38 +0000

while other apps looks like this

Service:              applinks
App ID:               ZL6BUSYGB3.com.apple.news
App Version:          2300.5
Domain:               news.apple.com
Patterns:             {"/":"*"}
User Approval:        unspecified
Site/Fmwk Approval:   approved
Flags:                systemApplication
Last Checked:         2019-09-25 18:45:50 +0000
Next Check:           2019-09-30 17:49:04 +0000

For some reason it's missing the Patterns (from AASA) and Site/Fmwk Approval is unspecified.

I also tried exporting sysdiagnose when universal link was working after several reinstalled and reboots. My app did have something for Patterns with Site/Fmwk Approval approved

Had anyone run into similar issues on iOS 13? Any help is highly appreciated

Answer

Sylvain Gravel picture Sylvain Gravel · Apr 15, 2020

After much testing, I found out the following is the format that works for both iOS12 and iOS13. iOS12, absolutely requires every details dictionnary entry to contain the appID and paths parameters to work properly. iOS13 on the other hand expects the first entry to contain both appIDs and components. This means the first entry absolutely needs to contain all 4 parameters to support both platforms for Autofill (with the Save Password prompt) and Universal Links.

Ironically, this format does not pass the Apple App Search API Validation Tool, but it does work for the Branch one... FTS! Note also that having your username and password UITextField on different VCs does not work (you will not get the Save Password prompt). I had to add a "fake" username UITextField on our password screen so it got picked up by the OS and DO NOT hide it, nor make either width or height 0px (so basically make it 1x1px in size, with clear text and background and fill it with your username from the previous VC).

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appIDs": [ "ABCDE12345.com.domain.app", "ABCDE12345.com.domain.app2" ],
        "appID": "ABCDE12345.com.domain.app",
        "components": [
          {
            "/": "/documentationsucksforios13",
            "comment": "This documentation is awful"
          }
        ],
        "paths": [ "/documentationsucksforios12" ]
      },
      {
        "appID": "ABCDE12345.com.domain.app2",
        "paths": [ "/validationtoolsdontwork" ]
      }
    ]
  },
  "webcredentials": {
    "apps": [ "ABCDE12345.com.domain.app" ]
  }
}