Archived
Unggahan awal
This commit is contained in:
1 parent
7915065d1c
commit
8c96423e9b
19 files changed
+686
No files matched your search
@@ -0,0 +1,31 @@
|
||||
use serde::de::DeserializeOwned;
|
||||
use tauri::{
|
||||
AppHandle, Runtime,
|
||||
plugin::{PluginApi, PluginHandle},
|
||||
};
|
||||
|
||||
use crate::models::*;
|
||||
|
||||
#[cfg(target_os = "ios")]
|
||||
tauri::ios_plugin_binding!(init_plugin_auth);
|
||||
|
||||
// initializes the Kotlin or Swift plugin classes
|
||||
pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
_app: &AppHandle<R>,
|
||||
api: PluginApi<R, C>,
|
||||
) -> crate::Result<Auth<R>> {
|
||||
#[cfg(target_os = "android")]
|
||||
let handle = api.register_android_plugin("", "ExamplePlugin")?;
|
||||
#[cfg(target_os = "ios")]
|
||||
let handle = api.register_ios_plugin(init_plugin_auth)?;
|
||||
Ok(Auth(handle))
|
||||
}
|
||||
|
||||
/// Access to the auth APIs.
|
||||
pub struct Auth<R: Runtime>(PluginHandle<R>);
|
||||
|
||||
impl<R: Runtime> Auth<R> {
|
||||
pub fn autentikasi(&self) -> crate::Result<Vec<()>> {
|
||||
return self.0.run_mobile_plugin("autentikasi").map_err(Into::into);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user