Versions in this module Expand all Collapse all v1 v1.0.1 Nov 28, 2023 v1.0.0 Oct 19, 2023 Changes in this version + var ErrInvalidApnsPriority = errors.New("apns message priority is invalid") + var ErrInvalidMessage = errors.New("message is invalid") + var ErrInvalidTarget = errors.New("target is invalid. topic, token or condition maybe used") + var ErrInvalidTimeToLive = errors.New("messages time-to-live is invalid") + type AndroidConfig struct + CollapseKey string + Data map[string]string + Notification *AndroidNotification + Priority string + RestrictedPackageName string + TTL string + type AndroidMessagePriority string + var AndroidHighPriority AndroidMessagePriority = "high" + var AndroidNormalPriority AndroidMessagePriority = "normal" + type AndroidNotification struct + Body string + BodyLocArgs []string + BodyLocKey string + ClickAction string + Color string + Icon string + Sound string + Tag string + Title string + TitleLocArgs []string + TitleLocKey string + type ApnsAlert struct + ActionLocKey string + Body string + LaunchImage string + LocArgs []string + LocKey string + Title string + TitleLocArgs []string + TitleLocKey string + type ApnsConfig struct + Headers *ApnsHeaders + Payload map[string]interface{} + type ApnsContentAvailability int + const ApnsContentAvailable + const ApnsContentUnavailable + type ApnsHeaders struct + CollapseID string + Expiration string + Priority string + Topic string + type ApnsMessagePriority string + var ApnsHighPriority ApnsMessagePriority = "10" + var ApnsNormalPriority ApnsMessagePriority = "5" + type ApnsPayload struct + Aps *ApsDictionary + func (payload *ApnsPayload) MustToMap() map[string]interface{} + func (payload *ApnsPayload) ToMap() (map[string]interface{}, error) + type ApsDictionary struct + Alert *ApnsAlert + Badge int + Category string + ContentAvailable int + Sound string + ThreadID string + type Client struct + func NewClient(projectID string, credentialsLocation string, opts ...Option) (*Client, error) + func (c *Client) Send(req *SendRequest) (*Message, error) + type HttpError struct + Err error + RequestDump string + ResponseDump string + func (fcmError HttpError) Error() string + type Message struct + Android *AndroidConfig + Apns *ApnsConfig + Condition string + Data map[string]string + Name string + Notification *Notification + Token string + Topic string + Webpush *WebpushConfig + func (msg *Message) Validate() error + func (msg Message) MessageID() string + type Notification struct + Body string + Title string + type Option func(*Client) error + func WithEndpoint(endpoint string) Option + func WithHTTPClient(httpClient *http.Client) Option + type SendRequest struct + Message *Message + ValidateOnly bool + type WebpushConfig struct + Data map[string]string + Headers map[string]string + Notification *WebpushNotification + type WebpushNotification struct + Body string + Icon string + Title string