From aee9230f586ad39bc9a1dc664c64367f8d75c434 Mon Sep 17 00:00:00 2001 From: monadoid Date: Sun, 7 Sep 2025 12:02:15 +0200 Subject: [PATCH 1/2] - Clarifies the two distinct approaches for mobile deep linking: App Links/Universal Links (verified) vs Custom URI schemes (unverified) --- src/content/docs/plugin/deep-linking.mdx | 68 ++++++++++++++++++++---- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/src/content/docs/plugin/deep-linking.mdx b/src/content/docs/plugin/deep-linking.mdx index 2f4f9cd072..6d7e168be2 100644 --- a/src/content/docs/plugin/deep-linking.mdx +++ b/src/content/docs/plugin/deep-linking.mdx @@ -81,8 +81,11 @@ Install the deep-link plugin to get started. ### Android -For [app links](https://developer.android.com/training/app-links#android-app-links), you need a server with a -`.well-known/assetlinks.json` endpoint that must return a text response in the given format: +There are two ways to open your app from links on Android: + +1. **App Links (http/https + host, verified)** + For [app links](https://developer.android.com/training/app-links#android-app-links), you need a server with a + `.well-known/assetlinks.json` endpoint that must return a text response in the given format: ```json title=".well-known/assetlinks.json" [ @@ -103,8 +106,14 @@ Where `$APP_BUNDLE_ID` is the value defined on [`tauri.conf.json > identifier`] `$CERT_FINGERPRINT` is a list of SHA256 fingerprints of your app's signing certificates, see [verify Android applinks] for more information. +2. **Custom URI schemes (no host required, no verification)** + 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`. + ### iOS +There are two ways to open your app from links on iOS: + +1. **Universal Links (https + host, verified)** For [universal links], you need a server with a `.well-known/apple-app-site-association` endpoint that must return a JSON response in the given format: @@ -145,6 +154,9 @@ curl -v https://app-site-association.cdn-apple.com/a/v1/ See [applinks.details](https://developer.apple.com/documentation/bundleresources/applinks/details) for more information. +2. **Custom URI schemes (no host, no verification)** + 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. + ### Desktop On Linux and Windows deep links are delivered as a command line argument to a new app process. @@ -187,16 +199,57 @@ and schemes registered at runtime must be manually checked using [`Env::args_os` ## Configuration -Under `tauri.conf.json > plugins > deep-link`, configure the domains (mobile) and schemes (desktop) you want to associate with your application: +Under `tauri.conf.json > plugins > deep-link`, configure mobile domains/schemes and desktop schemes you want to associate with your application. + + +### Examples + +**Custom scheme on mobile (no server required):** ```json title="tauri.conf.json" { "plugins": { "deep-link": { "mobile": [ - { "host": "your.website.com", "pathPrefix": ["/open"] }, - { "host": "another.site.br" } - ], + { + "scheme": ["ovi"], + "appLink": false + } + ] + } + } +} +``` + +This registers the `ovi://*` scheme on Android and iOS. + +**App Link / Universal Link (verified https + host):** + +```json +{ + "plugins": { + "deep-link": { + "mobile": [ + { + "scheme": ["https"], + "host": "your.website.com", + "pathPrefix": ["/open"], + "appLink": true + } + ] + } + } +} +``` + +This registers `https://your.website.com/open/*` as an app/universal link. + +**Desktop custom schemes:** + +```json +{ + "plugins": { + "deep-link": { "desktop": { "schemes": ["something", "my-tauri-app"] } @@ -205,9 +258,6 @@ Under `tauri.conf.json > plugins > deep-link`, configure the domains (mobile) an } ``` -With the above configuration, the `something://*` and `my-tauri-app://*` URLs are associated with your desktop application, -and on mobile the `https://another.site.br/*` and `https://your.website.com/open/*` URLs will open your mobile app. - ## Usage The deep-link plugin is available in both JavaScript and Rust. From 4fb2c2ce8f95fab9025e50ae2506335f4e299125 Mon Sep 17 00:00:00 2001 From: monadoid Date: Mon, 8 Sep 2025 18:56:15 +0200 Subject: [PATCH 2/2] prettier format --- src/content/docs/plugin/deep-linking.mdx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/content/docs/plugin/deep-linking.mdx b/src/content/docs/plugin/deep-linking.mdx index 6d7e168be2..85dd889f0b 100644 --- a/src/content/docs/plugin/deep-linking.mdx +++ b/src/content/docs/plugin/deep-linking.mdx @@ -84,8 +84,8 @@ Install the deep-link plugin to get started. There are two ways to open your app from links on Android: 1. **App Links (http/https + host, verified)** - For [app links](https://developer.android.com/training/app-links#android-app-links), you need a server with a - `.well-known/assetlinks.json` endpoint that must return a text response in the given format: + For [app links](https://developer.android.com/training/app-links#android-app-links), you need a server with a + `.well-known/assetlinks.json` endpoint that must return a text response in the given format: ```json title=".well-known/assetlinks.json" [ @@ -114,8 +114,8 @@ see [verify Android applinks] for more information. There are two ways to open your app from links on iOS: 1. **Universal Links (https + host, verified)** -For [universal links], you need a server with a `.well-known/apple-app-site-association` endpoint that must return a JSON response -in the given format: + For [universal links], you need a server with a `.well-known/apple-app-site-association` endpoint that must return a JSON response + in the given format: ```json title=".well-known/apple-app-site-association" { @@ -201,7 +201,6 @@ and schemes registered at runtime must be manually checked using [`Env::args_os` Under `tauri.conf.json > plugins > deep-link`, configure mobile domains/schemes and desktop schemes you want to associate with your application. - ### Examples **Custom scheme on mobile (no server required):**