Skip to content

Commit d64a11e

Browse files
authored
docs(deep-link) Clarifies app or universal links vs custom scheme mobile deep links (#3498)
1 parent 570142d commit d64a11e

File tree

1 file changed

+60
-11
lines changed

1 file changed

+60
-11
lines changed

src/content/docs/plugin/deep-linking.mdx

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ Install the deep-link plugin to get started.
8181

8282
### Android
8383

84-
For [app links](https://developer.android.com/training/app-links#android-app-links), you need a server with a
85-
`.well-known/assetlinks.json` endpoint that must return a text response in the given format:
84+
There are two ways to open your app from links on Android:
85+
86+
1. **App Links (http/https + host, verified)**
87+
For [app links](https://developer.android.com/training/app-links#android-app-links), you need a server with a
88+
`.well-known/assetlinks.json` endpoint that must return a text response in the given format:
8689

8790
```json title=".well-known/assetlinks.json"
8891
[
@@ -103,10 +106,16 @@ Where `$APP_BUNDLE_ID` is the value defined on [`tauri.conf.json > identifier`]
103106
`$CERT_FINGERPRINT` is a list of SHA256 fingerprints of your app's signing certificates,
104107
see [verify Android applinks] for more information.
105108

109+
2. **Custom URI schemes (no host required, no verification)**
110+
For URIs like `myapp://...`, you can declare a custom scheme without hosting any files. Use the `scheme` field in the mobile configuration and omit the `host`.
111+
106112
### iOS
107113

108-
For [universal links], you need a server with a `.well-known/apple-app-site-association` endpoint that must return a JSON response
109-
in the given format:
114+
There are two ways to open your app from links on iOS:
115+
116+
1. **Universal Links (https + host, verified)**
117+
For [universal links], you need a server with a `.well-known/apple-app-site-association` endpoint that must return a JSON response
118+
in the given format:
110119

111120
```json title=".well-known/apple-app-site-association"
112121
{
@@ -145,6 +154,9 @@ curl -v https://app-site-association.cdn-apple.com/a/v1/<host>
145154

146155
See [applinks.details](https://developer.apple.com/documentation/bundleresources/applinks/details) for more information.
147156

157+
2. **Custom URI schemes (no host, no verification)**
158+
For URIs like `myapp://...`, you can declare a custom scheme under mobile configuration with `"appLink": false` (or omit it). The plugin generates the appropriate `CFBundleURLTypes` entries in your app's Info.plist. No `.well-known` files or HTTPS host are needed.
159+
148160
### Desktop
149161

150162
On Linux and Windows deep links are delivered as a command line argument to a new app process.
@@ -187,16 +199,56 @@ and schemes registered at runtime must be manually checked using [`Env::args_os`
187199

188200
## Configuration
189201

190-
Under `tauri.conf.json > plugins > deep-link`, configure the domains (mobile) and schemes (desktop) you want to associate with your application:
202+
Under `tauri.conf.json > plugins > deep-link`, configure mobile domains/schemes and desktop schemes you want to associate with your application.
203+
204+
### Examples
205+
206+
**Custom scheme on mobile (no server required):**
191207

192208
```json title="tauri.conf.json"
193209
{
194210
"plugins": {
195211
"deep-link": {
196212
"mobile": [
197-
{ "host": "your.website.com", "pathPrefix": ["/open"] },
198-
{ "host": "another.site.br" }
199-
],
213+
{
214+
"scheme": ["ovi"],
215+
"appLink": false
216+
}
217+
]
218+
}
219+
}
220+
}
221+
```
222+
223+
This registers the `ovi://*` scheme on Android and iOS.
224+
225+
**App Link / Universal Link (verified https + host):**
226+
227+
```json
228+
{
229+
"plugins": {
230+
"deep-link": {
231+
"mobile": [
232+
{
233+
"scheme": ["https"],
234+
"host": "your.website.com",
235+
"pathPrefix": ["/open"],
236+
"appLink": true
237+
}
238+
]
239+
}
240+
}
241+
}
242+
```
243+
244+
This registers `https://your.website.com/open/*` as an app/universal link.
245+
246+
**Desktop custom schemes:**
247+
248+
```json
249+
{
250+
"plugins": {
251+
"deep-link": {
200252
"desktop": {
201253
"schemes": ["something", "my-tauri-app"]
202254
}
@@ -205,9 +257,6 @@ Under `tauri.conf.json > plugins > deep-link`, configure the domains (mobile) an
205257
}
206258
```
207259

208-
With the above configuration, the `something://*` and `my-tauri-app://*` URLs are associated with your desktop application,
209-
and on mobile the `https://another.site.br/*` and `https://your.website.com/open/*` URLs will open your mobile app.
210-
211260
## Usage
212261

213262
The deep-link plugin is available in both JavaScript and Rust.

0 commit comments

Comments
 (0)