John Costa 61e9258538 feat: saveToken plugin for app groups on iOS
This will allow the share extension to access the Bearer token to send
images to the backend.
2025-05-01 18:20:26 +01:00

23 lines
550 B
Rust

use serde::de::DeserializeOwned;
use tauri::{plugin::PluginApi, AppHandle, Runtime};
use crate::models::*;
pub fn init<R: Runtime, C: DeserializeOwned>(
app: &AppHandle<R>,
_api: PluginApi<R, C>,
) -> crate::Result<IosSharedToken<R>> {
Ok(IosSharedToken(app.clone()))
}
/// Access to the ios-shared-token APIs.
pub struct IosSharedToken<R: Runtime>(AppHandle<R>);
impl<R: Runtime> IosSharedToken<R> {
pub fn ping(&self, payload: PingRequest) -> crate::Result<PingResponse> {
Ok(PingResponse {
value: payload.value,
})
}
}