File tree Expand file tree Collapse file tree 3 files changed +426
-649
lines changed Expand file tree Collapse file tree 3 files changed +426
-649
lines changed Original file line number Diff line number Diff line change 12
12
"vite" : " ^4.5.3"
13
13
},
14
14
"dependencies" : {
15
- "firebase" : " ^9.22 .0" ,
15
+ "firebase" : " ^10.10 .0" ,
16
16
"pako" : " ^2.1.0"
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -270,8 +270,9 @@ window.disconnect = async () => {
270
270
window . tapPushNotification = async ( ) => {
271
271
try {
272
272
const pnKey = document . getElementById ( 'pn-key' ) . value
273
- const pushNotificationPayload = JSON . parse ( payload . value )
274
- const result = await readPushNotification ( pushNotificationPayload , pnKey )
273
+ const pnPayload = JSON . parse ( payload . value )
274
+ const { body } = pnPayload . notification
275
+ const result = await readPushNotification ( body , pnKey )
275
276
console . log ( 'PN' , result )
276
277
const { resultType, resultObject } = await client . handlePushNotification (
277
278
result
@@ -712,9 +713,10 @@ window.enablePushNotifications = async () => {
712
713
713
714
onMessage ( messaging , ( payload ) => {
714
715
console . log ( 'Push payload' , payload )
715
- document . getElementById ( 'payload' ) . value = payload . notification . body
716
- const body = JSON . parse ( payload . notification . body || '{}' )
717
- alert ( body . title )
716
+ const message = JSON . parse ( payload . data . message || '{}' )
717
+ document . getElementById ( 'payload' ) . value = payload . data . message
718
+ const messageBody = message . notification . body
719
+ alert ( messageBody . title )
718
720
} )
719
721
720
722
try {
You can’t perform that action at this time.
0 commit comments