#Notifications Support

15 messages · Page 1 of 1 (latest)

wispy sedge
#

I have a notifications system setup with the notifications API - works great. The only issue i am having is that the app by default should start in an opt-out state where the permission to send notifications is disabled, and it does this, however it then requests permission but i get no pop-up for this request and i assume it looks at the windows settings for this?

Specifically my question is this: How does permission get requested and can i set the permission dynamically at runtime through the app. I would like to give the user the ability to opt in or out of notifications via the UI that i am building.

Right now, it just happens auto-magically and i am lost where it gets the perms from.

lapis harness
#

Did you try it in a built app too or only tauri dev?

wispy sedge
lapis harness
#

because it's not really supposed to have notification permissions by default

#

but tauri dev may count as bash or powershell to the system

wispy sedge
#

On that note - is there a way (even in rust) to turn notifications perms off/on at runtime?

lapis harness
#

that may also be platform specific, on macos it should always ask since its handled by the system, on windows it will always return true iirc

wispy sedge
lapis harness
#

and it was kinda useless anyway

wispy sedge
lapis harness
#

yeah it was really suboptimal, especially since this way there were 2 permission dialogs on macos kkushLUL
But on Linux/Windows it also felt weird because you don't actually have to request permissions from the OS there.

So we figured we might as well let the devs decide what they want, and the built-in dialog was a simple ask dialog so a pre-built (optional) dialog doesn't save you much time/loc either 🤷