As mentioned in this video, we can now use the components
array and handle this kind of universal link in iOS 13 and above:
Beginning this year, we are replacing the paths
key with the components
key.
This key's value is an array of dictionaries, each of which contains zero or more URL components to pattern match against. As before, you can match against the URL's path
component whose key is the forward slash. If you need to support previous releases, you can keep the paths key.
iOS 13, tvOS 13 and macOS 10.15 will ignore it if the components key is present. And now you can match against the URL's fragment component whose key is the hash mark and you can match the query component whose key is the question mark.
Now many, if not most URLs out there divide their query component up into key value pairs called query items. For the query component, you can specify a dictionary instead of a string as its value and pattern match individual query items. URLs may repeat query item names and the operating system will require that all instances of a given query item name match your pattern.
Example:
"components": [
{
"/": "/help/*",
"?": { "articleNumber": "????", "articleName": "?*" },
"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, and another with name 'articleName' and a value of one or more characters"
}
]
Query items with no value and absent query items are treated by the operating system as if they have a value equal to the empty string.
For a components dictionary to match a candidate URL, all the specified components must match. If you don't specify a component, the operating system's default behavior is to simply ignore that component. So if, for example, your app doesn't care about the fragment component of a URL, you don't need to specify it in this file. You may have sections of your website that are not able to be represented in your app yet. You can exclude such subsections by specifying the exclude key with a Boolean value of true.
This key has the same behavior as a not keyword that you used in the old paths key. That key word is not supported when using the component's dictionary.