-
Notifications
You must be signed in to change notification settings - Fork 3.7k
notificationclose fired but notificationclick dose not fire #102
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
Comments
The issue was resolved. Reason for not firing: firebase-messaging.js has the following code. self.addEventListener("notificationclick", function(event) {
event.stopImmediatePropagation();
event.notification.close(); lib nofiticationclick-function was executing Resolution: Define my notificationclick-function before the library is loaded.
|
@14kw I was trying to figure this out the whole day and I was about to give up! |
should this be considered a bug? |
That gives me an idea |
@14kw You are lifesaver |
oh my god thanks for this... |
Damn, 5 hours wasted and it could've been fixed by moving the import scripts. -_- |
Still doesn't work for me :( |
still notworking forme |
Worked for me, Thanks for the Solution, You are a life saver |
Thank you very much! Just like the other people this has cost me many hours. I think Firebase should document this behaviour. |
Doesn't worked for me, anyone can tell me which version this approach works ? |
Hi, It is not working for me. Before importing the scripts I used self.addEventListener("notificationclick", function(event) { |
Currently the SDK sends the case of the notification click to the window (https://github.com/firebase/firebase-js-sdk/blob/15addde0b9d56dd3490e9c3c1e2f015e10e156cb/packages/messaging/src/listeners/sw-listeners.ts#L162) One could do that on the userland but the library stops the propagation of the notificationclick event. I think they should add a handler like "onNotificationClick" so the user could handle easily the click on the window side. |
Page with the URL specified by clickaction does not contain firebase-messaging.js.
So I want to obtain log with notificationclick rather than onmessage.
Notificationclose fired, but notificationclick did not fire.
How can I fire notificationclick?
push body
firebase-messaging-sw.js
Google Chrome 56.0.2924.87
The text was updated successfully, but these errors were encountered: