I´m using the new Universal Links feature of iOS, but want to disable certain paths of my homepage for the feature.
E.g.: All URLS that contain "_id_" and the starting page, but not http://example.com/testsite from the domain http://example.com should be opened within my app. How can I solve this?
My apple-app-site-association file on the server looks like this:
{
"activitycontinuation": {
"apps": [
"ABCDEFGHIJ.com.example.ios"
]
},
"applinks": {
"apps": [],
"details": [
{
"appID": "ABCDEFGHIJ.com.example.ios",
"paths": [
"/",
"*_id_*"
]
}
]
}
}
My entitlements file in the app:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>activitycontinuation:example.com</string>
<string>activitycontinuation:www.example.com</string>
<string>activitycontinuation:m.example.com</string>
<string>applinks:example.com</string>
<string>applinks:www.example.com</string>
<string>applinks:m.example.com</string>
</array>
</dict>
</plist>
I didn´t find any option to exclude certain paths. How is this feasible?
Prepending a path with NOT to excludes that path from being matched. Example -
{
"applinks": {
"apps": [ ],
"details": [
{
"appID": "{app_prefix}.{app_identifier}",
"paths": [ "NOT /path/to/exclude"]
}
]
}
}
Static
: The entire supported path is hardcoded to identify a specific link, e.g. /static/termsWildcards
: A * can be used to match dynamic paths, e.g. /books/* can matches the path to any author’s page. ? inside specific path components, e.g. books/1? can be used to match any books whose ID starts with 1.Exclusions
: Prepending a path with NOT excludes that path from being matched.
The order in which the paths are mentioned in the array is important. Earlier indices have higher priority. Once a path matches, the evaluation stops, and other paths ignored. Each path is case-sensitive.
How to support Universal Links in iOS App and setup server for it?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With