Open gato25 opened 6 months ago
Thanks, we will update the readme.
Because the plugin is mobile-only you have to register it like so:
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.setup(|app| {
#[cfg(mobile)]
{
app.handle().plugin(tauri_plugin_nfc::init())?;
}
})
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Thanks, we will update the readme.
Because the plugin is mobile-only you have to register it like so:
#[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() .setup(|app| { #[cfg(mobile)] { app.handle().plugin(tauri_plugin_nfc::init())?; } }) .invoke_handler(tauri::generate_handler![greet]) .run(tauri::generate_context!()) .expect("error while running tauri application"); }
{
"$schema": "../gen/schemas/mobile-schema.json",
****
the permissions, insert permissions of array then how do i easily test it working or not
Describe the bug
Tried to follow https://docs.rs/crate/tauri-plugin-nfc/latest
My lib.rs
[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() { tauri::Builder::default() .plugin(tauri_plugin_nfc::init()) .invoke_handler(tauri::generate_handler![greet]) .run(tauri::generate_context!()) .expect("error while running tauri application"); }
But this gives an error
.plugin(tauri_plugin_nfc::init()) | ^^^^ not found in `tauri_plugin_nfc
How do i solve this ?
I tried to import use tauri_plugin_nfc::init; but still same issue.
Reproduction
No response
Expected behavior
No response
Full
tauri info
outputStack trace
No response
Additional context
No response