notify

package
v0.0.0-...-7dcd445 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT, MIT, Unlicense Imports: 4 Imported by: 0

README

notify

Go Reference

Cross platform notifications for Gio applications.

Status

This repo is experimental, and does not have a stable interface. Currently notify only supports the following OSes:

  • linux (x11/wayland doesn't matter so long as dbus is used for notifications)
  • android
  • macOS (support is preliminary; some code-signing-related issues)
  • iOS (support is preliminary; some code-signing-related issues)

Use

See the package documentation of ./notification_manager.go for usage information.

Documentation

Overview

Package notify provides cross-platform notifications for Gio applications.

https://gioui.org

Sending a notification is easy:

notifier, _ := NewNotifier()
notification, _ := notifier.CreateNotification("hello!", "I was sent from Gio!")
notification.Cancel()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IconNotifier

type IconNotifier interface {
	Notifier
	UseIcon(path string)
}

IconNotifier is a notifier that can display an icon notification.

type Notification

type Notification interface {
	// Cancel a notification.
	Cancel() error
}

Notification handle that can used to manipulate a platform notification, such as by cancelling it.

func Push

func Push(title, text string) (Notification, error)

Push a notification to the OS.

type Notifier

type Notifier interface {
	CreateNotification(title, text string) (Notification, error)
}

Notifier provides methods for creating and managing notifications.

func NewNotifier

func NewNotifier() (Notifier, error)

NewNotifier creates a new Manager tailored to the current operating system.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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