From 3c85b5ca03d92a1dcf897cd1caf99c249af26832 Mon Sep 17 00:00:00 2001 From: Akanksha Jaiswal Date: Tue, 6 Aug 2024 15:24:50 -0700 Subject: [PATCH 1/2] enable direct boot ok in Android config --- .idea/.gitignore | 8 ++++++++ .idea/firebase-admin-go.iml | 9 +++++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ messaging/messaging.go | 1 + messaging/messaging_test.go | 29 +++++++++++++++++++++++++++++ 6 files changed, 61 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/firebase-admin-go.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/firebase-admin-go.iml b/.idea/firebase-admin-go.iml new file mode 100644 index 00000000..5e764c4f --- /dev/null +++ b/.idea/firebase-admin-go.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..9e56e1e0 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/messaging/messaging.go b/messaging/messaging.go index 858e75ff..2b362db8 100644 --- a/messaging/messaging.go +++ b/messaging/messaging.go @@ -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). diff --git a/messaging/messaging_test.go b/messaging/messaging_test.go index 388154b0..0603b6c0 100644 --- a/messaging/messaging_test.go +++ b/messaging/messaging_test.go @@ -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{ From 66004209fde39f391e4021b8e5b8894bb72b5f4f Mon Sep 17 00:00:00 2001 From: Akanksha Jaiswal Date: Tue, 27 Aug 2024 10:16:46 -0700 Subject: [PATCH 2/2] remove .idea --- .idea/.gitignore | 8 -------- .idea/firebase-admin-go.iml | 9 --------- .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 4 files changed, 31 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/firebase-admin-go.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b81..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/firebase-admin-go.iml b/.idea/firebase-admin-go.iml deleted file mode 100644 index 5e764c4f..00000000 --- a/.idea/firebase-admin-go.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 9e56e1e0..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddf..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file