Skip to content

Commit f6aae7a

Browse files
committed
fix: revert ios to prior logic
1 parent b3b6db2 commit f6aae7a

File tree

8 files changed

+20
-204
lines changed

8 files changed

+20
-204
lines changed

plugins/deep-link/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ fn main() {
6666
let result = tauri_plugin::Builder::new(COMMANDS)
6767
.global_api_script_path("./api-iife.js")
6868
.android_path("android")
69-
.ios_path("ios")
7069
.try_build();
7170

7271
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build

plugins/deep-link/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test <br />
2+
3+
<a href="taurideeplink://open">cant touch this</a>

plugins/deep-link/ios/.gitignore

Lines changed: 0 additions & 10 deletions
This file was deleted.

plugins/deep-link/ios/Package.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

plugins/deep-link/ios/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

plugins/deep-link/ios/Sources/DeepLinkPlugin.swift

Lines changed: 0 additions & 116 deletions
This file was deleted.

plugins/deep-link/ios/Tests/PluginTests/PluginTests.swift

Lines changed: 0 additions & 8 deletions
This file was deleted.

plugins/deep-link/src/lib.rs

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ pub use error::{Error, Result};
1616
#[cfg(target_os = "android")]
1717
const PLUGIN_IDENTIFIER: &str = "app.tauri.deep_link";
1818

19-
#[cfg(target_os = "ios")]
20-
tauri::ios_plugin_binding!(init_plugin_deep_link);
21-
2219
fn init_deep_link<R: Runtime>(
2320
app: &AppHandle<R>,
2421
api: PluginApi<R, Option<config::Config>>,
2522
) -> crate::Result<DeepLink<R>> {
26-
#[cfg(mobile)]
23+
#[cfg(target_os = "android")]
2724
{
2825
let _api = api;
2926

@@ -32,12 +29,8 @@ fn init_deep_link<R: Runtime>(
3229
Emitter,
3330
};
3431

35-
#[cfg(target_os = "android")]
3632
let handle = _api.register_android_plugin(PLUGIN_IDENTIFIER, "DeepLinkPlugin")?;
3733

38-
#[cfg(target_os = "ios")]
39-
let handle = _api.register_ios_plugin(init_plugin_deep_link)?;
40-
4134
#[derive(serde::Deserialize)]
4235
struct Event {
4336
url: String,
@@ -64,25 +57,23 @@ fn init_deep_link<R: Runtime>(
6457
},
6558
)?;
6659

67-
#[cfg(target_os = "android")]
68-
{
69-
return Ok(DeepLink {
70-
app: app.clone(),
71-
plugin_handle: handle,
72-
});
73-
}
60+
return Ok(DeepLink {
61+
app: app.clone(),
62+
plugin_handle: handle,
63+
});
64+
}
7465

75-
#[cfg(target_os = "ios")]
76-
{
77-
return Ok(DeepLink {
78-
app: app.clone(),
79-
plugin_handle: handle,
80-
current: Default::default(),
81-
})
82-
}
66+
#[cfg(target_os = "ios")]
67+
{
68+
let deep_link = DeepLink {
69+
app: app.clone(),
70+
current: Default::default(),
71+
config: api.config().clone(),
72+
};
73+
Ok(deep_link)
8374
}
8475

85-
#[cfg(desktop)]
76+
#[cfg(any(desktop))]
8677
{
8778
let args = std::env::args();
8879
let deep_link = DeepLink {
@@ -96,7 +87,7 @@ fn init_deep_link<R: Runtime>(
9687
}
9788
}
9889

99-
#[cfg(mobile)]
90+
#[cfg(target_os = "android")]
10091
mod imp {
10192
use std::sync::Mutex;
10293
use tauri::{ipc::Channel, plugin::PluginHandle, AppHandle, Runtime};
@@ -115,14 +106,6 @@ mod imp {
115106
pub url: Option<url::Url>,
116107
}
117108

118-
/// Access to the deep-link APIs.
119-
pub struct DeepLink<R: Runtime> {
120-
pub(crate) app: AppHandle<R>,
121-
pub(crate) plugin_handle: PluginHandle<R>,
122-
#[cfg(target_os = "ios")]
123-
pub(crate) current: Mutex<Option<Vec<url::Url>>>,
124-
}
125-
126109
impl<R: Runtime> DeepLink<R> {
127110
/// Get the current URLs that triggered the deep link. Use this on app load to check whether your app was started via a deep link.
128111
///
@@ -174,7 +157,7 @@ mod imp {
174157
}
175158
}
176159

177-
#[cfg(not(mobile))]
160+
#[cfg(not(target_os = "android"))]
178161
mod imp {
179162
use std::sync::Mutex;
180163
#[cfg(target_os = "linux")]

0 commit comments

Comments
 (0)