Skip to content

Commit baa9d76

Browse files
committed
Update Webpush types in Messaging
Webpush Notification is a struct now: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#webpushconfig
1 parent 2e1f464 commit baa9d76

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/messaging/messaging.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,7 @@ export interface Notification {
126126
export interface WebpushConfig {
127127
headers?: {[key: string]: string};
128128
data?: {[key: string]: string};
129-
notification?: WebpushNotification;
130-
}
131-
132-
export interface WebpushNotification {
133-
title?: string;
134-
body?: string;
135-
icon?: string;
129+
notification?: {[key: string]: any};
136130
}
137131

138132
export interface ApnsConfig {

test/unit/messaging/messaging.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,6 +2236,22 @@ describe('Messaging', () => {
22362236
title: 'test.title',
22372237
body: 'test.body',
22382238
icon: 'test.icon',
2239+
actions: [{
2240+
action: 'test.action.1',
2241+
title: 'test.action.1.title',
2242+
icon: 'test.action.1.icon',
2243+
}, {
2244+
action: 'test.action.2',
2245+
title: 'test.action.2.title',
2246+
icon: 'test.action.2.icon',
2247+
}],
2248+
badge: 'test.badge',
2249+
data: {
2250+
key: 'value',
2251+
},
2252+
dir: 'auto',
2253+
image: 'test.image',
2254+
requireInteraction: true,
22392255
},
22402256
},
22412257
},

0 commit comments

Comments
 (0)