Skip to content

Commit 56926c1

Browse files
chemidyhiranya911
authored andcommitted
add channel_id in messaging.AndroidNotification (#202)
* add channel_id in messaging.AndroidNotification * fix lint
1 parent 5741cc6 commit 56926c1

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Unreleased
22

3+
- [added] `messaging.AndroidNotification`type now supports channel_id.
34
- [dropped] Dropped support for Go 1.8 and earlier.
45
- [fixed] Fixing error handling in FCM. The SDK now checks the key
56
`type.googleapis.com/google.firebase.fcm.v1.FcmError` to set error code.

messaging/messaging.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ type AndroidNotification struct {
215215
BodyLocArgs []string `json:"body_loc_args,omitempty"`
216216
TitleLocKey string `json:"title_loc_key,omitempty"`
217217
TitleLocArgs []string `json:"title_loc_args,omitempty"`
218+
ChannelID string `json:"channel_id,omitempty"`
218219
}
219220

220221
// WebpushConfig contains messaging options specific to the WebPush protocol.

messaging/messaging_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ var validMessages = []struct {
148148
TitleLocArgs: []string{"t1", "t2"},
149149
BodyLocKey: "blk",
150150
BodyLocArgs: []string{"b1", "b2"},
151+
ChannelID: "channel",
151152
},
152153
TTL: &ttlWithNanos,
153154
},
@@ -165,6 +166,7 @@ var validMessages = []struct {
165166
"title_loc_args": []interface{}{"t1", "t2"},
166167
"body_loc_key": "blk",
167168
"body_loc_args": []interface{}{"b1", "b2"},
169+
"channel_id": "channel",
168170
},
169171
"ttl": "1.500000000s",
170172
},

0 commit comments

Comments
 (0)