From 55733aba9c5a5c8d664afea0c83d9337bc99387d Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Tue, 2 Jul 2024 23:40:01 -0300 Subject: [PATCH] fix(core): iOS compilation without the wry feature (#10176) Ref https://github.com/tauri-apps/plugins-workspace/pull/1402 --- .changes/with-webview-wry-feature.md | 5 +++++ core/tauri/src/manager/webview.rs | 2 +- core/tauri/src/plugin/mobile.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changes/with-webview-wry-feature.md diff --git a/.changes/with-webview-wry-feature.md b/.changes/with-webview-wry-feature.md new file mode 100644 index 000000000..1e8cb4fc7 --- /dev/null +++ b/.changes/with-webview-wry-feature.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:bug +--- + +Move `PluginApi::register_ios_plugin` behind the `wry` Cargo feature as `Webview::with_webview` is only available when that feature is enabled. diff --git a/core/tauri/src/manager/webview.rs b/core/tauri/src/manager/webview.rs index c7b2e100c..d1001bbf3 100644 --- a/core/tauri/src/manager/webview.rs +++ b/core/tauri/src/manager/webview.rs @@ -631,7 +631,7 @@ impl WebviewManager { .webview_created(webview_); }); - #[cfg(target_os = "ios")] + #[cfg(all(target_os = "ios", feature = "wry"))] { webview .with_webview(|w| { diff --git a/core/tauri/src/plugin/mobile.rs b/core/tauri/src/plugin/mobile.rs index e5ecd4951..5a543934b 100644 --- a/core/tauri/src/plugin/mobile.rs +++ b/core/tauri/src/plugin/mobile.rs @@ -152,7 +152,7 @@ impl fmt::Display for ErrorResponse { impl PluginApi { /// Registers an iOS plugin. - #[cfg(target_os = "ios")] + #[cfg(all(target_os = "ios", feature = "wry"))] pub fn register_ios_plugin( &self, init_fn: unsafe fn() -> *const std::ffi::c_void,