notifier

package
v0.93.3-fix Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IOS identifier for an iOS notification.
	IOS = 1
	// Android identifier for an android notification.
	Android = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	Tokens   []string `json:"tokens"`
	Platform float32  `json:"platform"`
	Message  string   `json:"message"`
}

Notification details for gorush.

type Notifier

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

Notifier handles android and ios push notifications.

func New

func New(url string) *Notifier

New notifier connected to the specified server.

func (*Notifier) Send

func (n *Notifier) Send(notifications []*Notification) error

Send a push notification to given devices.

type Response

type Response struct {
	Logs []struct {
		Type  string `json:"type"`
		Error string `json:"error"`
	} `json:"logs"`
}

Response from gorush.

Jump to

Keyboard shortcuts

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