wix / react-native-notifications

React Native Notifications
MIT License
3.23k stars 763 forks source link

Callback on registerRemoteNotificationsRegistered immediately fired #854

Closed djibarian closed 2 years ago

djibarian commented 2 years ago

I've noticed that calling Notifications.events().registerRemoteNotificationsRegistered(callback) immediately fires the callback. Is this the expected behaviour?

If so, it's a bit confusing, as I am delaying the call to the callback until Notifications.registerRemoteNotifications() as a result of the user being logged in to get the user's Id. But with the current behaviour I have to check inside the callback if the user's Id is available, which is not ideal.

passengerV commented 2 years ago

If this behavior is present only on Android, it's due Firebase's auto-initialization. By default, if there is connection to the internet the Firebase's SDK will generate a token and .registerRemoteNotificationsRegistered will be triggered.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 2 years ago

The issue has been closed for inactivity.