forked from akai/readest
4f0ef01a17
To enable background playback in Android, go to Settings > Apps & Notifications > Readest > Battery > Battery Optimization, and disable battery optimization for Readest.
38 lines
902 B
Rust
38 lines
902 B
Rust
use tauri::{command, AppHandle, Runtime};
|
|
|
|
use crate::models::*;
|
|
use crate::NativeBridgeExt;
|
|
use crate::Result;
|
|
|
|
#[command]
|
|
pub(crate) async fn auth_with_safari<R: Runtime>(
|
|
app: AppHandle<R>,
|
|
payload: AuthRequest,
|
|
) -> Result<AuthResponse> {
|
|
app.native_bridge().auth_with_safari(payload)
|
|
}
|
|
|
|
#[command]
|
|
pub(crate) async fn auth_with_custom_tab<R: Runtime>(
|
|
app: AppHandle<R>,
|
|
payload: AuthRequest,
|
|
) -> Result<AuthResponse> {
|
|
app.native_bridge().auth_with_custom_tab(payload)
|
|
}
|
|
|
|
#[command]
|
|
pub(crate) async fn copy_uri_to_path<R: Runtime>(
|
|
app: AppHandle<R>,
|
|
payload: CopyURIRequest,
|
|
) -> Result<CopyURIResponse> {
|
|
app.native_bridge().copy_uri_to_path(payload)
|
|
}
|
|
|
|
#[command]
|
|
pub(crate) async fn use_background_audio<R: Runtime>(
|
|
app: AppHandle<R>,
|
|
payload: UseBackgroundAudioRequest,
|
|
) -> Result<()> {
|
|
app.native_bridge().use_background_audio(payload)
|
|
}
|