Skip to content

Commit ef89071

Browse files
committed
feat: explicit app link declarations
1 parent dbcbd54 commit ef89071

File tree

16 files changed

+158
-178
lines changed

16 files changed

+158
-178
lines changed

plugins/deep-link/build.rs

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ fn main() {
8484
panic!("Deep link config validation failed:\n{}", errors.join("\n"));
8585
}
8686

87-
8887
tauri_plugin::mobile::update_android_manifest(
8988
"DEEP LINK PLUGIN",
9089
"activity",
@@ -98,21 +97,38 @@ fn main() {
9897
.expect("failed to rewrite AndroidManifest.xml");
9998

10099

101-
#[cfg(target_os = "macos")]
100+
#[cfg(any(target_os = "macos", target_os = "ios"))]
102101
{
103-
tauri_plugin::mobile::update_entitlements(|entitlements| {
104-
entitlements.insert(
105-
"com.apple.developer.associated-domains".into(),
106-
config
102+
// we need to ensure that the entitlements are only
103+
// generated for explicit app links and not
104+
// other deep links or web links because then they
105+
// are just going to complain and not be built or signed
106+
let has_app_links = config
107+
.mobile
108+
.iter()
109+
.any(|d| d.is_app_link());
110+
111+
if !has_app_links {
112+
tauri_plugin::mobile::update_entitlements(|entitlements| {
113+
entitlements.remove("com.apple.developer.associated-domains");
114+
})
115+
.expect("failed to update entitlements");
116+
} else {
117+
tauri_plugin::mobile::update_entitlements(|entitlements| {
118+
entitlements.insert(
119+
"com.apple.developer.associated-domains".into(),
120+
config
107121
.mobile
108122
.iter()
123+
.filter(|d| d.is_app_link())
109124
.filter_map(|d| d.host.as_ref())
110125
.map(|host| format!("applinks:{}", host).into())
111126
.collect::<Vec<_>>()
112127
.into(),
113-
);
114-
})
115-
.expect("failed to update entitlements");
128+
);
129+
})
130+
.expect("failed to update entitlements");
131+
}
116132
}
117133
}
118134
}

plugins/deep-link/examples/app/src-tauri/gen/android/app/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/src/main/java/com/tauri/deep_link_example/generated
1+
/src/main/java/com/kodski/deep_link_example/generated
22
/src/main/jniLibs/**/*.so
33
/src/main/assets/tauri.conf.json
44
/tauri.build.gradle.kts

plugins/deep-link/examples/app/src-tauri/gen/android/app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ val tauriProperties = Properties().apply {
1515

1616
android {
1717
compileSdk = 36
18-
namespace = "com.tauri.deep_link_example"
18+
namespace = "com.kodski.deep_link_example"
1919
defaultConfig {
2020
manifestPlaceholders["usesCleartextTraffic"] = "false"
21-
applicationId = "com.tauri.deep_link_example"
21+
applicationId = "com.kodski.deep_link_example"
2222
minSdk = 24
2323
targetSdk = 36
2424
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<action android:name="android.intent.action.VIEW" />
5252
<category android:name="android.intent.category.DEFAULT" />
5353
<category android:name="android.intent.category.BROWSABLE" />
54-
<data android:scheme="w3ds" />
54+
<data android:scheme="taurideeplink" />
5555

5656

5757

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.tauri.deep_link_example
1+
package com.kodski.deep_link_example
22

33
import android.os.Bundle
44
import androidx.activity.enableEdgeToEdge
File renamed without changes.
File renamed without changes.
Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,116 @@
11
{
2-
"images": [
2+
"images" : [
33
{
4-
"size": "20x20",
5-
"idiom": "iphone",
6-
"filename": "[email protected]",
7-
"scale": "2x"
4+
"size" : "20x20",
5+
"idiom" : "iphone",
6+
"filename" : "[email protected]",
7+
"scale" : "2x"
88
},
99
{
10-
"size": "20x20",
11-
"idiom": "iphone",
12-
"filename": "[email protected]",
13-
"scale": "3x"
10+
"size" : "20x20",
11+
"idiom" : "iphone",
12+
"filename" : "[email protected]",
13+
"scale" : "3x"
1414
},
1515
{
16-
"size": "29x29",
17-
"idiom": "iphone",
18-
"filename": "[email protected]",
19-
"scale": "2x"
16+
"size" : "29x29",
17+
"idiom" : "iphone",
18+
"filename" : "[email protected]",
19+
"scale" : "2x"
2020
},
2121
{
22-
"size": "29x29",
23-
"idiom": "iphone",
24-
"filename": "[email protected]",
25-
"scale": "3x"
22+
"size" : "29x29",
23+
"idiom" : "iphone",
24+
"filename" : "[email protected]",
25+
"scale" : "3x"
2626
},
2727
{
28-
"size": "40x40",
29-
"idiom": "iphone",
30-
"filename": "[email protected]",
31-
"scale": "2x"
28+
"size" : "40x40",
29+
"idiom" : "iphone",
30+
"filename" : "[email protected]",
31+
"scale" : "2x"
3232
},
3333
{
34-
"size": "40x40",
35-
"idiom": "iphone",
36-
"filename": "[email protected]",
37-
"scale": "3x"
34+
"size" : "40x40",
35+
"idiom" : "iphone",
36+
"filename" : "[email protected]",
37+
"scale" : "3x"
3838
},
3939
{
40-
"size": "60x60",
41-
"idiom": "iphone",
42-
"filename": "[email protected]",
43-
"scale": "2x"
40+
"size" : "60x60",
41+
"idiom" : "iphone",
42+
"filename" : "[email protected]",
43+
"scale" : "2x"
4444
},
4545
{
46-
"size": "60x60",
47-
"idiom": "iphone",
48-
"filename": "[email protected]",
49-
"scale": "3x"
46+
"size" : "60x60",
47+
"idiom" : "iphone",
48+
"filename" : "[email protected]",
49+
"scale" : "3x"
5050
},
5151
{
52-
"size": "20x20",
53-
"idiom": "ipad",
54-
"filename": "[email protected]",
55-
"scale": "1x"
52+
"size" : "20x20",
53+
"idiom" : "ipad",
54+
"filename" : "[email protected]",
55+
"scale" : "1x"
5656
},
5757
{
58-
"size": "20x20",
59-
"idiom": "ipad",
60-
"filename": "[email protected]",
61-
"scale": "2x"
58+
"size" : "20x20",
59+
"idiom" : "ipad",
60+
"filename" : "[email protected]",
61+
"scale" : "2x"
6262
},
6363
{
64-
"size": "29x29",
65-
"idiom": "ipad",
66-
"filename": "[email protected]",
67-
"scale": "1x"
64+
"size" : "29x29",
65+
"idiom" : "ipad",
66+
"filename" : "[email protected]",
67+
"scale" : "1x"
6868
},
6969
{
70-
"size": "29x29",
71-
"idiom": "ipad",
72-
"filename": "[email protected]",
73-
"scale": "2x"
70+
"size" : "29x29",
71+
"idiom" : "ipad",
72+
"filename" : "[email protected]",
73+
"scale" : "2x"
7474
},
7575
{
76-
"size": "40x40",
77-
"idiom": "ipad",
78-
"filename": "[email protected]",
79-
"scale": "1x"
76+
"size" : "40x40",
77+
"idiom" : "ipad",
78+
"filename" : "[email protected]",
79+
"scale" : "1x"
8080
},
8181
{
82-
"size": "40x40",
83-
"idiom": "ipad",
84-
"filename": "[email protected]",
85-
"scale": "2x"
82+
"size" : "40x40",
83+
"idiom" : "ipad",
84+
"filename" : "[email protected]",
85+
"scale" : "2x"
8686
},
8787
{
88-
"size": "76x76",
89-
"idiom": "ipad",
90-
"filename": "[email protected]",
91-
"scale": "1x"
88+
"size" : "76x76",
89+
"idiom" : "ipad",
90+
"filename" : "[email protected]",
91+
"scale" : "1x"
9292
},
9393
{
94-
"size": "76x76",
95-
"idiom": "ipad",
96-
"filename": "[email protected]",
97-
"scale": "2x"
94+
"size" : "76x76",
95+
"idiom" : "ipad",
96+
"filename" : "[email protected]",
97+
"scale" : "2x"
9898
},
9999
{
100-
"size": "83.5x83.5",
101-
"idiom": "ipad",
102-
"filename": "[email protected]",
103-
"scale": "2x"
100+
"size" : "83.5x83.5",
101+
"idiom" : "ipad",
102+
"filename" : "[email protected]",
103+
"scale" : "2x"
104104
},
105105
{
106-
"size": "1024x1024",
107-
"idiom": "ios-marketing",
108-
"filename": "[email protected]",
109-
"scale": "1x"
106+
"size" : "1024x1024",
107+
"idiom" : "ios-marketing",
108+
"filename" : "[email protected]",
109+
"scale" : "1x"
110110
}
111111
],
112-
"info": {
113-
"version": 1,
114-
"author": "xcode"
112+
"info" : {
113+
"version" : 1,
114+
"author" : "xcode"
115115
}
116-
}
116+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"info": {
3-
"version": 1,
4-
"author": "xcode"
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
55
}
6-
}
6+
}

plugins/deep-link/examples/app/src-tauri/gen/apple/LaunchScreen.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17150" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17150" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
33
<dependencies>
44
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17122"/>
55
<capability name="Safe area layout guides" minToolsVersion="9.0"/>

0 commit comments

Comments
 (0)