Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NotificationInit ¶
func NotificationInit()
Types ¶
type AppMessage ¶
type AppMessage struct {
Notification AppMessageNotification `json:"notification"`
}
type AppMessageCard ¶
type AppMessageEmblemCounter ¶
type AppMessageNotification ¶
type AppMessageNotification struct { Tag string `json:"tag"` Card AppMessageCard `json:"card"` Sound bool `json:"sound"` Vibrate bool `json:"vibrate"` EmblemCounter AppMessageEmblemCounter `json:"emblem-counter"` }
type Card ¶
type Card struct { // Summary is a required title. The card will not be presented if this is missing. Summary string `json:"summary"` // Body is the longer text. Body string `json:"body,omitempty"` // Whether to show a bubble. Users can disable this, and can easily miss // them, so don’t rely on it exclusively. Popup bool `json:"popup,omitempty"` // Actions provides actions for the bubble's snap decissions. Actions []string `json:"actions,omitempty"` // Icon is a path to an icon to display with the notification bubble. Icon string `json:"icon,omitempty"` // Whether to show in notification centre. Persist bool `json:"persist,omitempty"` Timestamp int64 `json:"timestamp"` }
Card is part of a notification and represents the user visible hints for a specific notification.
type Notification ¶
type Notification struct { Card *Card `json:"card,omitempty"` RawSound json.RawMessage `json:"sound"` RawVibration json.RawMessage `json:"vibrate"` Tag string `json:"tag,omitempty"` }
Notification (optional) describes the user-facing notifications triggered by this push message.
type NotificationHandler ¶
type NotificationHandler struct {
// contains filtered or unexported fields
}
var (
Nh *NotificationHandler
)
func NewLegacyHandler ¶
func NewLegacyHandler(conn *dbus.Connection, application string) *NotificationHandler
func (*NotificationHandler) Clear ¶ added in v0.8.0
func (n *NotificationHandler) Clear(tag int64) error
func (*NotificationHandler) NewStandardPushMessage ¶
func (n *NotificationHandler) NewStandardPushMessage(summary, body, icon string, tag string) *PushMessage
NewStandardPushMessage creates a base Notification with common components (members) setup.
func (*NotificationHandler) Send ¶
func (n *NotificationHandler) Send(m *PushMessage) error
Send sends a push notification to the system after running some checks
type PushMessage ¶
type PushMessage struct { // Notification (optional) describes the user-facing notifications // triggered by this push message. Notification Notification `json:"notification,omitempty"` Message string `json:"message,omitempty"` }
PushMessage represents a data structure to be sent over to the Post Office. It consists of a Notification and a Message.
type VariantMap ¶
Click to show internal directories.
Click to hide internal directories.