wix / react-native-notifications

React Native Notifications
MIT License
3.25k stars 764 forks source link

Question - registerNotificationReceivedBackground on Android #952

Closed mjmostachetti closed 1 year ago

mjmostachetti commented 1 year ago

I'm on 4.3.3 of this package and 67.5 for React Native.

When I register for registerNotificationReceivedBackground it works as expected - I put the app in the background and receive notifications, even if I close the app. When I close the app and open the app again and reregister, it fires twice now. If I unregister when the app closes, then I don't receive notifications in the background anymore. Am I missing something or is this expected behaviour? Thanks.

mjmostachetti commented 1 year ago

Just to test, I created a new project with just this package and the bare-bones latest RN code. RN - 0.71.3 RNN - 4.3.3

It was kind of interesting. I did not dispose any of the EventEmitter returned from the .events(). I no longer saw the +1 issue when restarting the application, although once the application closed, I no longer received notifications with the application closed.

I made sure to follow the instructions in the Android setup, and it seems like including this line is out-of-date classpath 'com.google.gms:google-services:4.0.0'

stale[bot] commented 1 year 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.

dleavittpmc commented 1 year ago

I'm getting a similar problem, did you find a solution?

mjmostachetti commented 1 year ago

No. I pulled in the react native firebase package and use that for android and this package still for iOS.

On Wed, Apr 12, 2023 at 4:05 PM David Leavitt @.***> wrote:

I'm getting a similar problem, did you find a solution?

— Reply to this email directly, view it on GitHub https://github.com/wix/react-native-notifications/issues/952#issuecomment-1506078585, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRPWL4O5QKGX3M77NTQ6KDXA4YMNANCNFSM6AAAAAAVN7NPV4 . You are receiving this because you authored the thread.Message ID: @.***>

stale[bot] commented 1 year 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 1 year ago

The issue has been closed for inactivity.