diff --git a/src-tauri/plugins/tauri-plugin-unifiedpush/src/commands.rs b/src-tauri/plugins/tauri-plugin-unifiedpush/src/commands.rs index 27fd11718..948167c08 100644 --- a/src-tauri/plugins/tauri-plugin-unifiedpush/src/commands.rs +++ b/src-tauri/plugins/tauri-plugin-unifiedpush/src/commands.rs @@ -1,6 +1,8 @@ use tauri::{AppHandle, Runtime}; use serde::{Deserialize, Serialize}; +use crate::mobile; + #[derive(Debug, Deserialize)] pub struct DistributorArgs { pub name: String, @@ -22,8 +24,7 @@ pub async fn list_distributors( ) -> Result, String> { #[cfg(target_os = "android")] { - use tauri::Manager; - let plugin = _app.state::>().0.clone(); + let plugin = _app.state::>().inner().0.clone(); plugin .run_mobile_plugin_async::>("listDistributors", ()) .await @@ -42,8 +43,7 @@ pub async fn set_distributor( ) -> Result<(), String> { #[cfg(target_os = "android")] { - use tauri::Manager; - let plugin = _app.state::>().0.clone(); + let plugin = _app.state::>().inner().0.clone(); plugin .run_mobile_plugin::<()>("setDistributor", args) .map_err(|e| e.to_string()) @@ -60,8 +60,7 @@ pub async fn register_for_push_notifications( ) -> Result { #[cfg(target_os = "android")] { - use tauri::Manager; - let plugin = _app.state::>().0.clone(); + let plugin = _app.state::>().inner().0.clone(); plugin .run_mobile_plugin_async::( "registerForPushNotifications", @@ -83,8 +82,7 @@ pub async fn unregister_for_push_notifications( ) -> Result<(), String> { #[cfg(target_os = "android")] { - use tauri::Manager; - let plugin = _app.state::>().0.clone(); + let plugin = _app.state::>().inner().0.clone(); plugin .run_mobile_plugin::<()>("unregisterForPushNotifications", ()) .map_err(|e| e.to_string()) @@ -102,8 +100,7 @@ pub async fn set_token( ) -> Result<(), String> { #[cfg(target_os = "android")] { - use tauri::Manager; - let plugin = _app.state::>().0.clone(); + let plugin = _app.state::>().inner().0.clone(); plugin .run_mobile_plugin::<()>("setToken", args) .map_err(|e| e.to_string())