Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDestination = errors.New("No destination: please specifify a device or a topic")
)
Error List
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a common interface for both APNS and FCM
type Destination ¶
type Destination struct {
Topic string `json:"topic,omitempty"`
Device string `json:"device,omitempty"`
}
Destination is message recepient or topic
type Message ¶
type Message struct {
Apple *Destination `json:"apple,omitempty"`
Google *Destination `json:"google,omitempty"`
Priority Priority `json:"priority,omitempty"`
TTL time.Duration `json:"ttl,omitempty"`
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
CollapseID string `json:"collapse_id,omitempty"`
IsData bool `json:"is_data,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
}
Message is the notification data
func (Message) ToApns ¶
func (m Message) ToApns() *apns.Notification
ToApns converts the Message to a the Apns version
func (Message) ToFirebase ¶
ToFirebase converts the Message to a the Firebase version
Click to show internal directories.
Click to hide internal directories.