Skip to content

Commit 42cded2

Browse files
Merge pull request #5603 from MicrosoftDocs/copilot/fix-4510
Document allowSubdomains field for web-to-app linking JSON configuration
2 parents 9c3675a + 4d98764 commit 42cded2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

hub/apps/develop/launch/web-to-app-linking.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ Create a JSON file (without the .json file extension) named **windows-app-web-li
6363

6464
Windows will make an https connection to your website and will look for the corresponding JSON file on your web server.
6565

66+
### Subdomain support
67+
68+
If your app manifest includes both a main domain (for example, `example.com`) and wildcard subdomains (for example, `*.example.com`), you need to add the `allowSubdomains` field to your JSON file to enable subdomain linking. Without this field, links to subdomains will open in the browser instead of your app.
69+
70+
``` JSON
71+
[{
72+
"packageFamilyName" : "Your app's package family name, e.g MyApp_9jmtgj1pbbz6e",
73+
"paths" : [ "*" ],
74+
"excludePaths" : [ "/news/*", "/blog/*" ],
75+
"allowSubdomains" : true
76+
}]
77+
```
78+
79+
When `allowSubdomains` is set to `true`, links to subdomains like `subdomain.example.com/path` will correctly open in your app instead of the browser.
80+
6681
### Wildcards
6782

6883
The JSON file example above demonstrates the use of wildcards. Wildcards allow you to support a wide variety of links with fewer lines of code. Web-to-app linking supports two types of wildcards in the JSON file:
@@ -90,6 +105,9 @@ If you have two apps that you would like to link to your website, list both of t
90105
}]
91106
```
92107

108+
> [!NOTE]
109+
> If your apps need to support subdomains, add `"allowSubdomains": true` to each app entry in the JSON file.
110+
93111
To provide the best experience for your users, use exclude paths to make sure that online-only content is excluded from the supported paths in your JSON file.
94112

95113
Exclude paths are checked first and if there is a match the corresponding page will be opened with the browser instead of the designated app. In the example above, ‘/news/\*’ includes any pages under that path while ‘/news\*’ (no forward slash trails 'news') includes any paths under ‘news\*’ such as ‘newslocal/’, ‘newsinternational/’, and so on.

0 commit comments

Comments
 (0)