-
Notifications
You must be signed in to change notification settings - Fork 0
/
push.go
38 lines (33 loc) · 1.74 KB
/
push.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package firebasetools
// FirebaseWebpushConfigInput is used to set the Firebase web config
type FirebaseWebpushConfigInput struct {
Headers map[string]interface{} `json:"headers"`
Data map[string]interface{} `json:"data"`
}
// FirebaseAPNSConfigInput is used to set Apple APNS settings
type FirebaseAPNSConfigInput struct {
Headers map[string]interface{} `json:"headers"`
}
// FirebaseSimpleNotificationInput is used to create/send simple FCM notifications
type FirebaseSimpleNotificationInput struct {
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
ImageURL *string `json:"image,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
}
// FirebaseAndroidConfigInput is used to send Firebase Android config values
type FirebaseAndroidConfigInput struct {
Priority string `json:"priority"` // one of "normal" or "high"
CollapseKey *string `json:"collapseKey"`
RestrictedPackageName *string `json:"restrictedPackageName"`
Data map[string]interface{} `json:"data"` // if specified, overrides the Data field on Message type
}
// SendNotificationPayload is used to serialise and save incoming Send FCM notification requests.
type SendNotificationPayload struct {
RegistrationTokens []string `json:"registrationTokens"`
Data map[string]string `json:"data"`
Notification *FirebaseSimpleNotificationInput `json:"notification"`
Android *FirebaseAndroidConfigInput `json:"android"`
Ios *FirebaseAPNSConfigInput `json:"ios"`
Web *FirebaseWebpushConfigInput `json:"web"`
}