README

notify

Go Reference

Cross platform notifications for Gio applications.

Status

This repo is experimental, and does not have a stable interface. Currently niotify 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.

Expand ▾ Collapse ▴

Documentation

Overview

    Package niotify provides cross-platform notifications for Gio applications. https://gioui.org

    It aims to eventually support all Gio target platforms, but currently only supports android and linux.

    Sending a notification is easy:

    // NOTE: error handling omitted
    // construct a manager
    manager, _ := NewManager()
    // send notification
    notification, _ := manager.CreateNotification("hello!", "I was sent from Gio!")
    
    // you can also cancel notifications
    notification.Cancel()
    

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Manager

    type Manager struct {
    	// contains filtered or unexported fields
    }

      Manager provides methods for creating and managing notifications.

      func NewManager

      func NewManager() (Manager, error)

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

        func (Manager) CreateNotification

        func (m Manager) CreateNotification(title, text string) (*Notification, error)

          CreateNotification creates and sends a notification on the current platform. NOTE: it currently only supports Android and Linux. All other platforms are a no-op.

          type Notification

          type Notification struct {
          	// contains filtered or unexported fields
          }

            Notification provides a cross-platform set of methods to manage a sent Notification.

            func (*Notification) Cancel

            func (n *Notification) Cancel() error

              Cancel attempts to remove a previously-created notification from view on the current platform.

              Directories

              Path Synopsis
              cmd