Skip to content

Commit f3486ce

Browse files
chemidyhiranya911
authored andcommitted
add AndroidNotification channel_id (#407)
1 parent 245f31c commit f3486ce

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

CHANGELOG.md

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

3-
-
3+
- [added] `messaging.AndroidNotification`type now supports channel_id.
44

55
# v6.3.0
66

src/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ declare namespace admin.messaging {
431431
bodyLocArgs?: string[];
432432
titleLocKey?: string;
433433
titleLocArgs?: string[];
434+
channelId?: string;
434435
};
435436

436437
type ApnsConfig = {

src/messaging/messaging.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ export interface AndroidNotification {
213213
bodyLocArgs?: string[];
214214
titleLocKey?: string;
215215
titleLocArgs?: string[];
216+
channelId?: string;
216217
}
217218

218219
/**
@@ -463,6 +464,7 @@ function validateAndroidNotification(notification: AndroidNotification) {
463464
bodyLocArgs: 'body_loc_args',
464465
titleLocKey: 'title_loc_key',
465466
titleLocArgs: 'title_loc_args',
467+
channelId: 'channel_id',
466468
};
467469
renameProperties(notification, propertyMappings);
468470
}

test/unit/messaging/messaging.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,6 +2097,7 @@ describe('Messaging', () => {
20972097
titleLocArgs: ['arg1', 'arg2'],
20982098
bodyLocKey: 'body.loc.key',
20992099
bodyLocArgs: ['arg1', 'arg2'],
2100+
channelId: 'test.channel',
21002101
},
21012102
},
21022103
},
@@ -2110,6 +2111,7 @@ describe('Messaging', () => {
21102111
title_loc_args: ['arg1', 'arg2'],
21112112
body_loc_key: 'body.loc.key',
21122113
body_loc_args: ['arg1', 'arg2'],
2114+
channel_id: 'test.channel',
21132115
},
21142116
},
21152117
},
@@ -2157,6 +2159,7 @@ describe('Messaging', () => {
21572159
titleLocArgs: ['arg1', 'arg2'],
21582160
bodyLocKey: 'body.loc.key',
21592161
bodyLocArgs: ['arg1', 'arg2'],
2162+
channelId: 'test.channel',
21602163
},
21612164
},
21622165
},
@@ -2182,6 +2185,7 @@ describe('Messaging', () => {
21822185
title_loc_args: ['arg1', 'arg2'],
21832186
body_loc_key: 'body.loc.key',
21842187
body_loc_args: ['arg1', 'arg2'],
2188+
channel_id: 'test.channel',
21852189
},
21862190
},
21872191
},

0 commit comments

Comments
 (0)