Skip to content

Commit

Permalink
feat(fcm): enable direct_boot_ok as bool in Android config (#638)
Browse files Browse the repository at this point in the history
* enable direct boot ok in Android config

* remove .idea
  • Loading branch information
akankshaJaiswal8 authored Oct 21, 2024
1 parent 911c7e8 commit e69dcb0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions messaging/messaging.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ type AndroidConfig struct {
Data map[string]string `json:"data,omitempty"` // if specified, overrides the Data field on Message type
Notification *AndroidNotification `json:"notification,omitempty"`
FCMOptions *AndroidFCMOptions `json:"fcm_options,omitempty"`
DirectBootOk bool `json:"direct_boot_ok,omitempty"`
}

// MarshalJSON marshals an AndroidConfig into JSON (for internal use only).
Expand Down
29 changes: 29 additions & 0 deletions messaging/messaging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,35 @@ var validMessages = []struct {
"topic": "test-topic",
},
},
{
name: "AndroidDataMessage",
req: &Message{
Android: &AndroidConfig{
DirectBootOk: true,
CollapseKey: "ck",
Data: map[string]string{
"k1": "v1",
"k2": "v2",
},
Priority: "normal",
TTL: &ttl,
},
Topic: "test-topic",
},
want: map[string]interface{}{
"android": map[string]interface{}{
"direct_boot_ok": true,
"collapse_key": "ck",
"data": map[string]interface{}{
"k1": "v1",
"k2": "v2",
},
"priority": "normal",
"ttl": "10s",
},
"topic": "test-topic",
},
},
{
name: "AndroidNotificationMessage",
req: &Message{
Expand Down

0 comments on commit e69dcb0

Please sign in to comment.