Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAvailable ¶
func IsAvailable() bool
IsAvailable checks if the machine has notification support and returns true if it does, false otherwise.
Example:
if notification.IsAvailable() == false { fmt.Printf("Desktop notifications are not available") return }
func SendNotification ¶
func SendNotification(notification *types.Notification) error
SendNotification sends a desktop notification. It requires a Notification instance as an argument, you can create one using the types.NewNotification function.
Example:
notification := types.NewNotification( "BatmanApp", "Batman Alert", "Joker is attacking Gotham City!", "batman", 5000, types.NotificationAction{ Label: "Save Gotham", Callback: func() { fmt.Printf("Gotham saved!") }, }, ) err := notification.Send() if err != nil { fmt.Printf("Error: %v\n", err) return }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.