Handle Universal links with react native on iOS

Viewed 43

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

0 Answers
Related