tauri-apps / plugins-workspace

All of the official Tauri plugins in one place!
https://tauri.app
Apache License 2.0
936 stars 260 forks source link

[notification] registerActionTypes fails with Command register_action_types not found #1903

Open jude-iwuji opened 2 weeks ago

jude-iwuji commented 2 weeks ago

My code

const types: ActionType[] = [{ actions: [], id: 'chat-message' }];
await registerActionTypes(types);

Permissions:

"notification:default",
    "notification:allow-register-action-types",
    "notification:allow-register-listener",
    "notification:allow-is-permission-granted",
    "notification:allow-check-permissions",
    "notification:allow-cancel",
    "notification:allow-list-channels",
    "notification:allow-delete-channel",
    "notification:allow-create-channel",
    "notification:allow-request-permission",
    "notification:allow-show",
    "notification:allow-notify",
    "notification:allow-get-active"

Environment: Windows 11

FabianLars commented 2 weeks ago

registerActionTypes is a mobile only api. The error and docs should be clearer about that so i'll keep this issue open.

judeiwuji commented 2 weeks ago

@FabianLars please how can I listen to when a notification is clicked on windows. Can't find it in the doc.

FabianLars commented 2 weeks ago

This feature is not implemented yet

khaitbek commented 6 days ago

This feature is not implemented yet

When are you planning to implement it? I currently need this feature. I need to redirect the user to another website when they click on the notification. Can you give any other workaround ideas?

FabianLars commented 5 days ago

There are no concrete plans, and looking at the convo in https://github.com/hoodie/notify-rust/issues/186 it's not trivial to implement.

The only other workaround that i saw (in tauri apps but also in non-tauri apps) is to simulate a notification with a normal app window. This of course is only really viable on windows (imo). Though if you only need Windows support you could may as well use the inner windows bindings instead of notify-rust (which this plugin uses) https://docs.rs/tauri-winrt-notification/latest/tauri_winrt_notification/