notify

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPermissionNotGranted = errors.New("notification permission not granted")

ErrPermissionNotGranted is returned by Notify when a registered provider cannot post because the OS has not granted notification permission.

Providers deliver through a void platform call — Android's NotificationManagerCompat.notify, for example — so a dropped notification is invisible to Go. The Android shell's Notifier.Show returns early when the permission is missing (correctly: posting would be discarded anyway), which left Notify returning nil for a notification the user never saw, and every caller reporting success for a no-op. Checking the permission first is the only way to tell the two apart.

Functions

func Notify

func Notify(title, body string) error

func PermissionGranted

func PermissionGranted() bool

func RequestPermission

func RequestPermission() string

func SetNotifier

func SetNotifier(n Notifier)

Types

type Notifier

type Notifier interface {
	Show(title, body string) error
	PermissionGranted() bool
	RequestPermission() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL