flutter / flutter/website

[docs] iOS deeplink `apple-app-site-association` file content is different from referenced Apple documentation and misleading

Open
#12,362 0 comments 1 reaction 1 assignee Claimed by @lamek View on GitHub
a.cookbook e2-days p2-medium
Dominant language
Dart
Stars
3.1k
Forks
3.5k
Avg merge
2d 4h
Merged PRs (30d)
95

Description

Looking at the docs in https://docs.flutter.dev/cookbook/navigation/set-up-universal-links#create-and-host-apple-app-site-association-json-file, we have this

> This file uses the JSON format. Don't include the .json file extension when you save this file. Per [Apple's documentation](https://developer.apple.com/documentation/xcode/supporting-associated-domains), this file should resemble the following content
>
> ```
> {
> "applinks": {
> "apps": [],
> "details": [
> {
> "appIDs": [
> "S8QB4VV633.com.example.deeplinkCookbook"
> ],
> "paths": [
> "*"
> ],
> "components": [
> {
> "/": "/*"
> }
> ]
> }
> ]
> },
> "webcredentials": {
> "apps": [
> "S8QB4VV633.com.example.deeplinkCookbook"
> ]
> }
> }
> ```

But looking at the referenced Apple documentation at https://developer.apple.com/documentation/xcode/supporting-associated-domains I see this instead

> The following JSON code represents the contents of a simple association file:
>
> ```
> {
> "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": ["ABCDE12345.com.example.MyApp.Clip"]
> }
> }
> ```

My question now is

Image

Was this a typo or am I missing something because this seems to be misleading especially since the doc goes on to say

> 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.

But in the referenced Apple doc it seems this is actually done inside

`"components": [...]`

Which doc should I follow here the Flutter doc or the Apple doc or am I missing something

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.