Unggahan awal

This commit is contained in:
2026-04-14 18:36:14 +07:00
parent 240227ce02
commit 9db8123021
43 changed files with 713 additions and 2 deletions
+34
View File
@@ -0,0 +1,34 @@
use serde::de::DeserializeOwned;
use tauri::{
plugin::{PluginApi, PluginHandle},
AppHandle, Runtime,
};
use crate::models::*;
#[cfg(target_os = "ios")]
tauri::ios_plugin_binding!(init_plugin_bluclas);
// initializes the Kotlin or Swift plugin classes
pub fn init<R: Runtime, C: DeserializeOwned>(
_app: &AppHandle<R>,
api: PluginApi<R, C>,
) -> crate::Result<Bluclas<R>> {
#[cfg(target_os = "android")]
let handle = api.register_android_plugin("", "ExamplePlugin")?;
#[cfg(target_os = "ios")]
let handle = api.register_ios_plugin(init_plugin_bluclas)?;
Ok(Bluclas(handle))
}
/// Access to the bluclas APIs.
pub struct Bluclas<R: Runtime>(PluginHandle<R>);
impl<R: Runtime> Bluclas<R> {
pub fn ping(&self, payload: PingRequest) -> crate::Result<PingResponse> {
self
.0
.run_mobile_plugin("ping", payload)
.map_err(Into::into)
}
}