-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstruct.go
More file actions
47 lines (44 loc) · 1.44 KB
/
struct.go
File metadata and controls
47 lines (44 loc) · 1.44 KB
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
39
40
41
42
43
44
45
46
47
package gaurun
import "github.com/mercari/gaurun/gaurun"
const (
// PlatformAndroid is enum for FCM/GCM.
PlatformAndroid Platform = gaurun.PlatFormAndroid
// PlatformIOS is enum for APNs.
PlatformIOS Platform = gaurun.PlatFormIos
)
type (
// A Payload has notifications.
Payload struct {
Notifications []*Notification `json:"notifications"`
}
// A Notification has gaurun notification data.
Notification struct {
Tokens []string `json:"token"`
Platform Platform `json:"platform"`
Message string `json:"message"`
// Metadata
ID uint64 `json:"seq_id,omitempty"`
AndroidSetting
IOSSetting
}
// An AndroidSetting has setting fields for FCM/GCM.
AndroidSetting struct {
CollapseKey string `json:"collapse_key,omitempty"`
DelayWhileIdle bool `json:"delay_while_idle,omitempty"`
TimeToLive int `json:"time_to_live,omitempty"`
}
// An IOSSetting has setting fields for APNs.
IOSSetting struct {
Badge int `json:"badge,omitempty"`
Sound string `json:"sound,omitempty"`
ContentAvailable bool `json:"content_available,omitempty"`
MutableContent bool `json:"mutable_content,omitempty"`
Expiry int `json:"expiry,omitempty"`
Retry int `json:"retry,omitempty"`
Extend []*Extend `json:"extend,omitempty"`
}
// An Extend is alias gaurun.ExtendJSON.
Extend gaurun.ExtendJSON
// A Platform is alias gaurun platform enum.
Platform int
)