24

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

TKP
  • 443
  • 1
  • 9
  • 19

6 Answers6

25

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" ]
  }
}
Sylvain Gravel
  • 259
  • 4
  • 5
  • I'm about to try something similiar on my app. Why do you include "appID": "ABCDE12345.com.domain.app" and "paths": [ "/documentationsucksforios12" ] alongside with the ios13 definitions and not as a different element in the details array like you did with "appID": "ABCDE12345.com.domain.app2"? – Jero Apr 17 '20 at 17:13
  • 2
    My tests have shown that if the first element does not contain both, it does not work on either iOS13 or iOS12 depending on which one you take out. – Sylvain Gravel Apr 18 '20 at 19:02
  • 1
    This has to be an excepted answer: it work both on iOS12 and iOS13. – displayname Oct 01 '20 at 17:12
  • 1
    I have "paths": [ "*" ]. Can someone help me how it can be written with componets so that for every domain url link, it should open app? – Vinit Ingale Dec 18 '20 at 12:56
  • @SylvainGravel Do I need to add the paths key even though the path is specified in the components section? – Akshay Nov 20 '22 at 05:51
  • @Akshay For iOS12 support, yes. It's all described in my post. – Sylvain Gravel Nov 21 '22 at 14:06
5

It seems for ios13, the apple-site-app-association as a new format

{
  "applinks": {
      "details": [
           {
             "appIDs": [ "ABCDE12345.com.example.app", "ABCDE12345.com.example.app2" ],
             "components": [
               {
                  "#": "no_universal_links",
                  "exclude": true,
                  "comment": "Matches any URL whose fragment equals no_universal_links and instructs the system not to open it as a universal link"
               },
               {
                  "/": "/buy/*",
                  "comment": "Matches any URL whose path starts with /buy/"
               },
               {
                  "/": "/help/website/*",
                  "exclude": true,
                  "comment": "Matches any URL whose path starts with /help/website/ and instructs the system not to open it as a universal link"
               }
               {
                  "/": "/help/*",
                  "?": { "articleNumber": "????" },
                  "comment": "Matches any URL whose path starts with /help/ and which has a query item with name 'articleNumber' and a value of exactly 4 characters"
               }
             ]
           }
       ]
   },
   "webcredentials": {
      "apps": [ "ABCDE12345.com.example.app" ]
   }
}
Kevin Amiranoff
  • 13,440
  • 11
  • 59
  • 90
  • If you update like this it works on iOS 13 but not on iOS 12 anymore. – user1007522 Mar 24 '20 at 08:26
  • @user1007522 good point, I ll update the answer so it works for both versions – Kevin Amiranoff Mar 24 '20 at 08:27
  • 1
    The second example only works on iOS 13, not on iOS 12. For correct syntax see the answer from Sylvain Gravel. – displayname Oct 01 '20 at 17:10
  • @nauke. Seems you are right. I removed it and only left the answer for iOS 13 – Kevin Amiranoff Nov 16 '20 at 09:37
  • @KevinAmiranoff, For some reason sysdiagnose file is not showing applinks of my app in one device whereas it is showing in other devices. The device doesn’t show the app as well present in swcutil_show.txt in memory usage or Database section of the file. I was troubleshooting the universal link AASA download. – Rajan Maheshwari Jul 25 '21 at 18:01
1

Please replace the appId(TEAMID.bundle-identifier) with application identifier. It works for me.

0

We were running into a similar issue. After upgrading to iOS 13.1.2 it seems to be working correctly now. So apple has most likely resolved the bug on their end.

0

I had the same issue with iOS 13 only and it turned out that since iOS 13 the appID entry is now case sensitive. My app's bundle identifier and the entry in the appID of the AASA file mismatched only in casing. Example:

Bundle ID: TEAMID.com.company.EXAMPLE AASA entry:

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "TEAMID.com.company.example",
        "paths": [ "*" ]
      }...

Needed to fix the appID in AASA file and my problem was gone.

Kai
  • 1,277
  • 2
  • 15
  • 25
-2

Try to open Settings > Safari > Request Desktop Website > All websites > Switch Off.

This issue occurs more often on iPads, since it makes more sense to show desktop websites on big screens rather than on small ones.

From apple developer forums.

It resolved my problem, great