| Crates.io | tauri-plugin-mobile-onbackpressed-listener |
| lib.rs | tauri-plugin-mobile-onbackpressed-listener |
| version | 2.0.1 |
| created_at | 2025-03-29 11:53:34.496354+00 |
| updated_at | 2025-03-29 12:07:56.957678+00 |
| description | This plugin mainly provides event listener for controlling the onBackpressed action on mobile devices. |
| homepage | |
| repository | https://github.com/kingsword09/tauri-plugins-workspace |
| max_upload_size | |
| id | 1611124 |
| size | 172,896 |
| Platform | Supported |
|---|---|
| Linux | x |
| Windows | x |
| macOS | x |
| Android | ✓ |
| iOS | ✓ |
This plugin requires a Rust version of at least 1.77.2
There are three general methods of installation that we can recommend.
Install the Core plugin by adding the following to your Cargo.toml file:
src-tauri/Cargo.toml
[target.'cfg(any(target_os = "ios", target_os = "android"))'.dependencies]
tauri-plugin-mobile-onbackpressed-listener = "2.0.0"
use the cargo add command to install it automatically (mobile targets only):
cargo add tauri-plugin-mobile-onbackpressed-listener --target 'cfg(any(target_os = "ios", target_os = "android"))'
First you need to register the core plugin with Tauri:
src-tauri/src/lib.rs
pub fn run() {
tauri::Builder::default()
.setup(|app| {
#[cfg(any(target_os = "ios", target_os = "android"))]
app.handle().plugin(tauri_plugin_mobile_onbackpressed_listener::init())?;
Ok(())
})
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
import { registerBackEvent } from "jsr:@kingsword/tauri-plugin-mobile-onbackpressed-listener"