Barcode Scanner
Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes.
Supported Platforms
- Android
- iOS
Setup
This plugin requires a Rust version of at least 1.64
Install the barcode-scanner plugin to get started.
Use your project’s package manager to add the dependency:
-
Run
cargo add tauri-plugin-barcode-scanner
to add the plugin to the project’s dependencies inCargo.toml
. -
Modify
lib.rs
to initialize the plugin: -
Install the JavaScript Guest bindings using your preferred JavaScript package manager:
Usage
The barcode scanner plugin is available in JavaScript.
Permissions
By default all plugin commands are blocked and cannot be accessed.
You must define a list of permissions in your capabilities
configuration.
See Permissions Overview for more information.
Permission | Description |
---|---|
barcode-scanner:allow-cancel | Enables the cancel command without any pre-configured scope. |
barcode-scanner:deny-cancel | Denies the cancel command without any pre-configured scope. |
barcode-scanner:allow-check-permissions | Enables the check_permissions command without any pre-configured scope. |
barcode-scanner:deny-check-permissions | Denies the check_permissions command without any pre-configured scope. |
barcode-scanner:allow-open-app-settings | Enables the open_app_settings command without any pre-configured scope. |
barcode-scanner:deny-open-app-settings | Denies the open_app_settings command without any pre-configured scope. |
barcode-scanner:allow-request-permissions | Enables the request_permissions command without any pre-configured scope. |
barcode-scanner:deny-request-permissions | Denies the request_permissions command without any pre-configured scope. |
barcode-scanner:allow-scan | Enables the scan command without any pre-configured scope. |
barcode-scanner:deny-scan | Denies the scan command without any pre-configured scope. |
barcode-scanner:allow-vibrate | Enables the vibrate command without any pre-configured scope. |
barcode-scanner:deny-vibrate | Denies the vibrate command without any pre-configured scope. |
© 2024 Tauri Contributors. CC-BY / MIT