-1
{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "47BSW6D45T.com.acno.AppBundleId",
        "paths": [
          "/?v=*", "/v=*", "/*v=*"
        ]
      }
    ]
  }
}

I tried paths that is write in paths Array but did not open my url from message or mail or from safari

raavan199
  • 125
  • 1
  • 1
  • 10
  • I am not sure about the reference to google - you can't install your app association file into google.com. You can get the state of universal link association by generating a sysdiag on your device. – Paulw11 May 11 '20 at 14:08
  • it's just an example, please check now question – raavan199 May 11 '20 at 14:17

1 Answers1

0

The older paths element in the site association file that is used by iOS 12 and earlier only examines the path of the url.

From the documentation:

Note that only the path component of the URL is used for comparison. Other components, such as the query string or fragment identifier, are ignored.

If you only want your app to handle urls with a specific query string then you will need to check the query string in the URL once your app receives it.

If the query string doesn't meet your requirements then you can pass the URL to openURL to have it opened in Safari.

In iOS 13, the components key in your site association file can specify a query string match.

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "47BSW6D45T.com.acno.AppBundleId",
        "paths": [
          "*"
        ],
        "appIDs": ["47BSW6D45T.com.acno.AppBundleId"],
        "components":[
           {
              "/": "*",
              "?": { "v": "*" },
              "comment": "Matches any URL whose path starts with / and which has a query item with name 'v'"
           }
      }
    ]
  }
}
Paulw11
  • 108,386
  • 14
  • 159
  • 186
  • but it will open an App when I just write "www.domainname.com" also, I don't want to do that because it will open all the url in App with just "www.domainname.com" – raavan199 May 13 '20 at 07:24
  • There’s nothing you can do about it prior to iOS 13. You have to “bounce” into your app and back to the web site. It would be better to restructure your web site to have a specific path that opens your app – Paulw11 May 13 '20 at 07:40
  • so in iOS 13 can we do that without open an App and again bound back to safari – raavan199 May 13 '20 at 07:44
  • Yes, as per my answer you can filter based on the query string in iOS 13 – Paulw11 May 13 '20 at 07:44
  • I tried your code it's work same as we pass "*" in path in iOS 13(iPhone X), So did not work in my case – raavan199 May 13 '20 at 09:09
  • It may still pick up the `paths` element if it is there. You could try removing it. Also iOS only refreshes the site association file once or twice per day. You can check the sysdiagnose to see when it was last refreshed and when it will be refreshed next – Paulw11 May 13 '20 at 09:18
  • I applied without paths already first time, but get same result. and I checked after 12 hour of file update on domain. – raavan199 May 14 '20 at 05:17
  • Ok. Well, as I said, relying on just a query string off your site root probably isn't the best anyway. Even if you could get it to work on iOS 13, it would be broken on iOS 12 and earlier. – Paulw11 May 14 '20 at 05:39