#is addPluginListener broken ? (iOS)

1 messages · Page 1 of 1 (latest)

mortal kernel
#

Hello!

I tried to use addPluginListener, but I was not getting any event with the exported one from @tauri-apps/api/core. However, this seems to work: (changing registerListener to register_listener)

https://github.com/Manaf941/tauri-plugin-in_app_browser/blob/master/guest-js/utils.ts

export async function addPluginListener(plugin: string, event: string, cb: (payload: any) => void) {
    const handler = new Channel(cb)

    await invoke(
        `plugin:${plugin}|register_listener`,
        {
            event: event,
            handler: handler
        },
    )

    return new PluginListener(plugin, event, handler.id)
}

(Also with defining and enabling the <plugin-name>:allow-register-listener permission)

Is this intended ? this doesn't seem documented on https://tauri.app/develop/plugins/develop-mobile/#plugin-events

To repro, launch the example app on iOS: https://github.com/Manaf941/tauri-plugin-in_app_browser/tree/master/examples/tauri-app

mortal kernel