-
Notifications
You must be signed in to change notification settings - Fork 375
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
[question]: Why is the notifications event listener (both click and foregroundWillDisplay) event firing more than once? #1548
Comments
Hello @akeva001 would you be able to send the logs from your device reproducing this behavior? We'll be happy to investigate. Thanks! |
I have the same issue. Listeners are not getting removed on reload when developing locally. |
I stumbled across this log because I have just realised that in my own development environment the click event defined below is literally firing 45 (and growing) times when the application starts.......and no notifications have been clicked at all! :(
Seems consistent with HMR in play. |
You can call
before adding event listener to clear all previous listeners |
Is there documentation regarding that method that states that it will remove existing listeners? The SDK just says |
You are right. It's about removing notifications. |
This problem still persists. Has anyone solved it? |
` useEffect(() => {
}, [dispatch]); // Add dispatch to dependency array if needed` I am facing the same problem eventListener is getting called multiple. times |
i stil fight with this problem :) can anyone tell how to solve this? my app always listen event click when open the app or reload the app |
I doubt you will see the problem in production. It is usually just a symptom of the dev environment - especially if you use HMR |
So if i try to build with APK release mode or AAB, the above problem will not occur right? |
How can we help?
I am using the event listeners as described in the setup guide, but when I receive a notification, the events fire more than 10 times. How can I fix this?
Code of Conduct
The text was updated successfully, but these errors were encountered: