Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fcm): enable direct_boot_ok as bool in Android config #638

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the .idea directory from this PR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/firebase-admin-go.iml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the .idea directory and all the files under it from this PR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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