Open leandro-hermes opened 2 years ago
I was facing same issue when I override PusherPushNotifications.onNotificationReceived in service worker for showing notification manually.
solution was to pass same params to notification data as PusherSDK passes as in this line https://github.com/pusher/push-notifications-web/blob/master/src/service-worker.js#L134
data: { pusher: { customerPayload: payloadFromCallback, pusherMetadata, }, }
@Pusher Beams Teams, it would be nice if you also implement something like PusherPushNotifications.onNotificationClicked
and allow us to handle click logic without passing above data
Sometimes when I click on a browser's notification, the event received by the handler doesn't have the
data
attribute, so I get the following error:Note I'm using Beams inside an Angular project. So I imported the Beams' worker beside the already existing worker from Angular.