This will allow the share extension to access the Bearer token to send images to the backend.
23 lines
550 B
Rust
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,
|
|
})
|
|
}
|
|
}
|