localnotifications

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package localnotifications shows reminders the app schedules on the phone itself, with no server. For messages from a server, use push.

nimbus native plugin add local-notifications

ok, err := localnotifications.Request(ctx)
localnotifications.Schedule(ctx, localnotifications.Notification{
	ID: "table-7", Title: "Table 7 is waiting", Body: "Order's ready", After: 10 * time.Minute})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cancel

func Cancel(ctx context.Context, id string) error

Cancel takes one back.

func Request

func Request(ctx context.Context) (bool, error)

Request asks to show notifications, once.

func Schedule

func Schedule(ctx context.Context, n Notification) error

Schedule sets a reminder.

Types

type Notification

type Notification struct {
	ID    string        // a new one with the same ID replaces it
	Title string        // its heading
	Body  string        // its text
	After time.Duration // how long from now; at least a second
}

Notification is a reminder.

Jump to

Keyboard shortcuts

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