Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on notification click handler #99

Open
leandro-hermes opened this issue Oct 25, 2021 · 1 comment
Open

Error on notification click handler #99

leandro-hermes opened this issue Oct 25, 2021 · 1 comment

Comments

@leandro-hermes
Copy link

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:

image

image

Note
I'm using Beams inside an Angular project. So I imported the Beams' worker beside the already existing worker from Angular.

@gurminder
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants