#Listening to Plugin events with Rust on the backend

1 messages · Page 1 of 1 (latest)

supple tide
#

I'm currently trying to write a tauri android plugin, that triggers AccessibilityEvents on the Tauri Rust Backend. But I don't quite understand how I listen to Plugin events using Rust.
The documentation at https://v2.tauri.app/develop/plugins/develop-mobile/ only explains how to do it with the npm package.
I tried to listen to Plugin events using:

            app.listen_any("accessibilityEvent", |event| {
                if let Ok(payload) = serde_json::from_str::<AccessibilityEvent>(&event.payload()) {
                    println!("New event {}", payload.message);
                }
            });
           Ok(())

and on the android side

        trigger("accessibilityEvent", payload)

but it doesn't work

Would really appreciate any help, thanks in advance!

Tauri

The cross-platform app building toolkit

narrow acorn