Skip to content

Commit bf4a107

Browse files
committed
fix: conditional auto verify intent filter for android app links
1 parent 499c10e commit bf4a107

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

plugins/deep-link/build.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ fn intent_filter(domain: &AssociatedDomain) -> String {
1616
.map(|h| format!(r#"<data android:host="{h}" />"#))
1717
.unwrap_or_default();
1818

19+
let auto_verify = if domain.is_app_link() {
20+
r#"android:autoVerify="true" "#.to_string()
21+
} else {
22+
String::new()
23+
};
24+
1925
format!(
20-
r#"<intent-filter android:autoVerify="true">
26+
r#"<intent-filter {auto_verify}>
2127
<action android:name="android.intent.action.VIEW" />
2228
<category android:name="android.intent.category.DEFAULT" />
2329
<category android:name="android.intent.category.BROWSABLE" />

plugins/deep-link/examples/app/src-tauri/gen/android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
2424
</intent-filter>
2525
<!-- DEEP LINK PLUGIN. AUTO-GENERATED. DO NOT REMOVE. -->
26-
<intent-filter android:autoVerify="true">
26+
<intent-filter >
2727
<action android:name="android.intent.action.VIEW" />
2828
<category android:name="android.intent.category.DEFAULT" />
2929
<category android:name="android.intent.category.BROWSABLE" />
@@ -35,7 +35,7 @@
3535
<data android:pathPrefix="/intent" />
3636

3737
</intent-filter>
38-
<intent-filter android:autoVerify="true">
38+
<intent-filter android:autoVerify="true" >
3939
<action android:name="android.intent.action.VIEW" />
4040
<category android:name="android.intent.category.DEFAULT" />
4141
<category android:name="android.intent.category.BROWSABLE" />
@@ -47,7 +47,7 @@
4747

4848

4949
</intent-filter>
50-
<intent-filter android:autoVerify="true">
50+
<intent-filter >
5151
<action android:name="android.intent.action.VIEW" />
5252
<category android:name="android.intent.category.DEFAULT" />
5353
<category android:name="android.intent.category.BROWSABLE" />

plugins/deep-link/examples/app/src-tauri/tauri.conf.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"pathPrefix": ["/intent"]
3535
},
3636
{
37-
"host": "tauri.app"
37+
"host": "tauri.app",
38+
"appLink": true
3839
},
3940
{
4041
"scheme": ["taurideeplink"]

0 commit comments

Comments
 (0)