From 1c5b3b118d11a5d5ce38476b65b5aa1892d6a4fb Mon Sep 17 00:00:00 2001 From: fbenevides Date: Wed, 10 Apr 2024 15:13:35 +0200 Subject: [PATCH 1/3] Add more info to Android config --- requests.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/requests.go b/requests.go index d3f97df..99e79bf 100644 --- a/requests.go +++ b/requests.go @@ -18,7 +18,11 @@ type FcmNotification struct { } type FcmAndroidConfig struct { - Notification *FcmAndroidNotification `json:"notification"` + CollapseKey string `json:"collapse_key"` + Priority string `json:"priority,omitempty"` + TimeToLive *string `json:"ttl,omitempty"` + RestrictedPackageName string `json:"restricted_package_name,omitempty"` + Notification *FcmAndroidNotification `json:"notification"` } type FcmAndroidNotification struct { @@ -37,7 +41,7 @@ type FcmAndroidNotification struct { NotificationCount int `json:"notification_count,omitempty"` } -type FcmData map[string]map[string]interface{} +type FcmData map[string]interface{} type FcmSendHttpResponse struct { Status int `json:"-"` From 35b046159634ff6fc91cb38fb5c1b8da94a4effc Mon Sep 17 00:00:00 2001 From: fbenevides Date: Wed, 10 Apr 2024 16:46:33 +0200 Subject: [PATCH 2/3] Change data type to a map[string]string --- requests.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requests.go b/requests.go index 99e79bf..8d1d203 100644 --- a/requests.go +++ b/requests.go @@ -41,11 +41,12 @@ type FcmAndroidNotification struct { NotificationCount int `json:"notification_count,omitempty"` } -type FcmData map[string]interface{} +type FcmData map[string]string type FcmSendHttpResponse struct { Status int `json:"-"` Name string `json:"name"` + Error string `json:"-"` } type InstanceInformationResponse struct { From 0f46d806351fb6980ea0e4df00016ea670d8f8ea Mon Sep 17 00:00:00 2001 From: fbenevides Date: Wed, 10 Apr 2024 17:31:47 +0200 Subject: [PATCH 3/3] Remove error from http response --- requests.go | 1 - 1 file changed, 1 deletion(-) diff --git a/requests.go b/requests.go index 8d1d203..d7f59a5 100644 --- a/requests.go +++ b/requests.go @@ -46,7 +46,6 @@ type FcmData map[string]string type FcmSendHttpResponse struct { Status int `json:"-"` Name string `json:"name"` - Error string `json:"-"` } type InstanceInformationResponse struct {