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

Expost remove listeners for firebase messaging #240

Open
ubaidazad opened this issue Feb 5, 2024 · 0 comments
Open

Expost remove listeners for firebase messaging #240

ubaidazad opened this issue Feb 5, 2024 · 0 comments

Comments

@ubaidazad
Copy link

When listening to onMessage, onNotificationTap there is no way to remove listeners and is leading to memory leak

// on message
firebase()
    .messaging()
    .onMessage(async (remoteMessage) => {
      console.log({ remoteMessage });
    });

// on notification tap
    firebase()
      .messaging()
      .onNotificationTap((message) => {
        console.log({ message });
      });

there is no way to remove listeners as there is for firebase auth

firebase().auth().addAuthStateChangeListener
firebase().auth().removeAuthStateChangeListener
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

1 participant