Call Rust from Kotlin (Android) #10695
-
Hi, I've been looking around a bit and don't seem to see any way to call rust code from kotlin. I came across the plugins, but it seems to only be able to be initiated one way from rust->kotlin. Is there any equivalent to where I could initiate a call from the kotlin to rust? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@FabianLars (tagging you since you've been helpful in the past) Do you know if this is possible currently? The only way I could think of achieving this right now would be to poll the Kotlin code for updates via a plugin, but that seems overly complicated. Maybe I'm overlooking something? |
Beta Was this translation helpful? Give feedback.
(currently) not "unprompted". You can only register event listeners in Rust or use the Channel api. The (wip) geolocation plugin uses the channel approach too: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/geolocation/src/mobile.rs#L47-L82