File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ type AndroidConfig struct {
121
121
Data map [string ]string `json:"data,omitempty"` // if specified, overrides the Data field on Message type
122
122
Notification * AndroidNotification `json:"notification,omitempty"`
123
123
FCMOptions * AndroidFCMOptions `json:"fcm_options,omitempty"`
124
+ DirectBootOk bool `json:"direct_boot_ok,omitempty"`
124
125
}
125
126
126
127
// MarshalJSON marshals an AndroidConfig into JSON (for internal use only).
Original file line number Diff line number Diff line change @@ -144,6 +144,35 @@ var validMessages = []struct {
144
144
"topic" : "test-topic" ,
145
145
},
146
146
},
147
+ {
148
+ name : "AndroidDataMessage" ,
149
+ req : & Message {
150
+ Android : & AndroidConfig {
151
+ DirectBootOk : true ,
152
+ CollapseKey : "ck" ,
153
+ Data : map [string ]string {
154
+ "k1" : "v1" ,
155
+ "k2" : "v2" ,
156
+ },
157
+ Priority : "normal" ,
158
+ TTL : & ttl ,
159
+ },
160
+ Topic : "test-topic" ,
161
+ },
162
+ want : map [string ]interface {}{
163
+ "android" : map [string ]interface {}{
164
+ "direct_boot_ok" : true ,
165
+ "collapse_key" : "ck" ,
166
+ "data" : map [string ]interface {}{
167
+ "k1" : "v1" ,
168
+ "k2" : "v2" ,
169
+ },
170
+ "priority" : "normal" ,
171
+ "ttl" : "10s" ,
172
+ },
173
+ "topic" : "test-topic" ,
174
+ },
175
+ },
147
176
{
148
177
name : "AndroidNotificationMessage" ,
149
178
req : & Message {
You can’t perform that action at this time.
0 commit comments