skip to Main Content

I’m implementing universal links for react native.

I followed this instructions : https://reactnavigation.org/docs/deep-linking/ and for android it’s works well.
When i trying to do for iOS (Associated Domains i have some issues)

For this i followed this instructions : https://developer.apple.com/documentation/xcode/supporting-associated-domains?language=objc

  1. Create Associated Domain on xCode
  2. Create apple-app-site-association on .well-known folder (https://dev-bytel-suiviconso.azurewebsites.net/.well-known/apple-app-site-association)
  "applinks": {
    "details": [
      {
        "appIDs": [
          "ABCDE12345.com.example.app",
          "ABCDE12345.com.example.app2"
        ],
        "components": [
          {
            "#": "no_universal_links",
            "exclude": true,
            "comment": "Matches any URL with a fragment that equals no_universal_links and instructs the system not to open it as a universal link."
          },
          {
            "/": "/buy/*",
            "comment": "Matches any URL with a path that starts with /buy/."
          },
          {
            "/": "/help/website/*",
            "exclude": true,
            "comment": "Matches any URL with a path that starts with /help/website/ and instructs the system not to open it as a universal link."
          },
          {
            "/": "/help/*",
            "?": {
              "articleNumber": "????"
            },
            "comment": "Matches any URL with a path that starts with /help/ and that has a query item with name 'articleNumber' and a value of exactly four characters."
          }
        ]
      }
    ]
  },
  "webcredentials": {
    "apps": [
      "ABCDE12345.com.example.app"
    ]
  },
  "appclips": {
    "apps": [
      "ABCED12345.com.example.MyApp.Clip"
    ]
  }
}
  1. I checked my files is correct on this sites

enter image description here

but when i’m checking for ubereats.com or facebook
https://app-site-association.cdn-apple.com/a/v1/ubereats.com

the format for apple-app-site-association is different, they are using format defined here : https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "9JA89QQLNQ.com.apple.wwdc",
                "paths": [ "/wwdc/news/", "/videos/wwdc/2015/*"]
            },
            {
                "appID": "ABCD1234.com.apple.wwdc",
                "paths": [ "*" ]
            }
        ]
    }
}

open scheme

So which format i should use or where i have wrong ?

It’s finally work on simulator but not on real device

simulator

2

Answers


  1. Based on the format that is being used by sites like UberEats and Facebook, you should use the format defined in the Universal Links documentation by Apple.

    The format should look like this:

    {
        "applinks": {
            "apps": [],
            "details": [
                {
                    "appID": "your.bundle.id",
                    "paths": [ "your_desired_path/*"]
                }
            ]
        }
    }
    

    The appID key should contain your bundle ID, and the paths key should specify the desired path of your Universal Link. The apps key should be empty.

    If it’s not working on a real device, check if you have enabled Associated Domains on Xcode, and if you have the correct Bundle ID set in your Apple Developer account. It’s also important to check if the

    apple-app-site-association

    file is hosted on a secure server (HTTPS) and is accessible to your device.

    Login or Signup to reply.
  2. iOS will not open Universal Links with apps if the user types the url directly into the browser. Only when the user clicks a link, will iOS open the associated app.

    So, in order to test the setup, do not enter the link in Safari, but rather use:

    npx uri-scheme open "https://your-site/testpath" --ios
    

    Alternatively, create a reminder on the device (using the Reminders app) containing the link, and click it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search