Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/content/cookbook/navigation/set-up-universal-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,9 @@ this file should resemble the following content:
"appIDs": [
"S8QB4VV633.com.example.deeplinkCookbook"
],
"paths": [
"*"
],
"components": [
{
"/": "/*"
"/": "*"
}
]
Comment on lines 213 to 217
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better backward compatibility out of the box, I suggest re-adding the paths field to this example. While components is the modern approach, many developers still need to support older iOS versions. Providing an example that works for both modern and legacy versions by default is safer for users who might copy-paste the code without reading the instructions in detail. The accompanying text already does a great job explaining the purpose of each field, and this change would make the code example more robust.

Suggested change
"components": [
{
"/": "/*"
"/": "*"
}
]
"paths": [
"*"
],
"components": [
{
"/": "*"
}
]

}
Expand All @@ -232,11 +229,17 @@ this file should resemble the following content:
1. Set one value in the `appIDs` array to
`<team id>.<bundle id>`.

1. Set the `paths` array to `["*"]`.
The `paths` array specifies the allowed universal links.
Using the asterisk, `*` redirects every path to the Flutter app.
If needed, change the `paths` array value to a setting more
appropriate to your app.
1. Configure the `components` array.
This field allows you to specify the URL patterns that your app supports.
In the example above, `{"/": "*"}` allows all paths.
To exclude specific paths or match complex patterns, using `components`
is recommended for iOS 13 and later.

:::note
For support on iOS 12 and earlier, you must also provide the `paths` array:
`"paths": ["*"]`.
If you support both new and old iOS versions, providing both fields is valid.
:::

1. Host the file at a URL that resembles the following structure.

Expand Down
Loading