Documentation
¶
Index ¶
Constants ¶
const ( // FCMSendEndpoint is the endpoint for sending message to the Firebase Cloud Messaging (FCM) server. // See more on https://firebase.google.com/docs/cloud-messaging/server FCMSendEndpoint = "https://fcm.googleapis.com/fcm/send" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client abstracts the interaction between the application server and the FCM server. The developer must obtain an API key from the Google APIs Console page and pass it to the Client so that it can perform authorized requests on the application server's behalf. To send a message to one or more devices use the Client's Send methods.
type Message ¶
type Message struct { RegistrationIDs []string `json:"registration_ids"` CollapseKey string `json:"collapse_key,omitempty"` Data map[string]interface{} `json:"data,omitempty"` DelayWhileIdle bool `json:"delay_while_idle,omitempty"` TimeToLive int `json:"time_to_live,omitempty"` Priority string `json:"priority,omitempty"` RestrictedPackageName string `json:"restricted_package_name,omitempty"` DryRun bool `json:"dry_run,omitempty"` }
Message is used by the application server to send a message to the FCM server. See the documentation for FCM Architectural Overview for more information: https://firebase.google.com/docs/cloud-messaging/http-server-ref
func NewMessage ¶
NewMessage returns a new Message with the specified payload and registration IDs.
type Response ¶
type Response struct { MulticastID int64 `json:"multicast_id"` CanonicalIDs int `json:"canonical_ids"` Results []Result `json:"results"` }
Response represents the FCM server's response to the application server's sent message. See the documentation for FCM Architectural Overview for more information: https://firebase.google.com/docs/cloud-messaging/http-server-ref