pushnotification

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

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

func NewDispatcher

func NewDispatcher(eventBus *eventbus.Bus, interactionRepo interaction.Repository, taskRepo task.Repository, sender *Sender, baseEnv *config.BaseEnv) *Dispatcher

func (*Dispatcher) Start

func (d *Dispatcher) Start(ctx context.Context)

type NotificationAction

type NotificationAction struct {
	Action string `json:"action"`
	Title  string `json:"title"`
	Type   string `json:"type,omitempty"` // "button" (default) or "text" (inline reply)
}

NotificationAction represents an action button on the push notification. On supported platforms (Chrome Android), these render as buttons the user can tap without opening the app.

type NotificationPayload

type NotificationPayload struct {
	Title string `json:"title"`
	Body  string `json:"body"`
	URL   string `json:"url,omitempty"`
	Tag   string `json:"tag,omitempty"`

	// Enhanced fields for notification action support.
	InteractionID string               `json:"interactionId,omitempty"`
	ResponseToken string               `json:"responseToken,omitempty"`
	APIBaseURL    string               `json:"apiBaseUrl,omitempty"`
	Type          string               `json:"type,omitempty"` // "permission_request" or "question"
	Actions       []NotificationAction `json:"actions,omitempty"`
}

type Sender

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

func NewSender

func NewSender(vapidEnv *config.VAPIDEnv, repo pushsubscription.Repository) *Sender

func (*Sender) SendToAll

func (s *Sender) SendToAll(ctx context.Context, payload *NotificationPayload)

Jump to

Keyboard shortcuts

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