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 {
121121 Data map [string ]string `json:"data,omitempty"` // if specified, overrides the Data field on Message type
122122 Notification * AndroidNotification `json:"notification,omitempty"`
123123 FCMOptions * AndroidFCMOptions `json:"fcm_options,omitempty"`
124+ DirectBootOk bool `json:"direct_boot_ok,omitempty"`
124125}
125126
126127// 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 {
144144 "topic" : "test-topic" ,
145145 },
146146 },
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+ },
147176 {
148177 name : "AndroidNotificationMessage" ,
149178 req : & Message {
You can’t perform that action at this time.
0 commit comments