diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d0e2f8..24e8d0f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- [added] `messaging.AndroidNotification`type now supports channel_id. - [dropped] Dropped support for Go 1.8 and earlier. - [fixed] Fixing error handling in FCM. The SDK now checks the key `type.googleapis.com/google.firebase.fcm.v1.FcmError` to set error code. diff --git a/messaging/messaging.go b/messaging/messaging.go index 12d3fdb4..655a354e 100644 --- a/messaging/messaging.go +++ b/messaging/messaging.go @@ -215,6 +215,7 @@ type AndroidNotification struct { BodyLocArgs []string `json:"body_loc_args,omitempty"` TitleLocKey string `json:"title_loc_key,omitempty"` TitleLocArgs []string `json:"title_loc_args,omitempty"` + ChannelID string `json:"channel_id,omitempty"` } // WebpushConfig contains messaging options specific to the WebPush protocol. diff --git a/messaging/messaging_test.go b/messaging/messaging_test.go index d6307290..6d7abcfc 100644 --- a/messaging/messaging_test.go +++ b/messaging/messaging_test.go @@ -148,6 +148,7 @@ var validMessages = []struct { TitleLocArgs: []string{"t1", "t2"}, BodyLocKey: "blk", BodyLocArgs: []string{"b1", "b2"}, + ChannelID: "channel", }, TTL: &ttlWithNanos, }, @@ -165,6 +166,7 @@ var validMessages = []struct { "title_loc_args": []interface{}{"t1", "t2"}, "body_loc_key": "blk", "body_loc_args": []interface{}{"b1", "b2"}, + "channel_id": "channel", }, "ttl": "1.500000000s", },