Skip to main content

should_request_notification_permission

Function should_request_notification_permission 

Source
pub fn should_request_notification_permission(state: PermissionState) -> bool
Expand description

Whether the app must call request_permission() for the current notification permission state before any .show() will surface a banner.

On macOS a fresh install starts in Prompt / PromptWithRationale (the OS “not determined” authorization status). Until the app explicitly requests authorization, tauri-plugin-notification’s .show() posts into a notification centre the app was never registered with, so every banner is silently dropped — which is why the pre-break notification never appeared even though the scheduler fired it (#135). permission_state() reporting a determined value (Granted / Denied) means the user has already answered, so we neither need nor want to re-prompt.