pusher / pusher-websocket-react-native

React Native official Pusher SDK
MIT License
61 stars 51 forks source link

receive notifications when app is closed or in background #99

Closed iamhaaamed closed 1 year ago

iamhaaamed commented 1 year ago

I received notifications only when app is in foreground but not in closed or background state. How can we receive notifications when app is closed or in background?

Kaue-Romero commented 1 year ago

Hi @iamhaaamed I am using React-Native 0.71.4 and I still receiving the notifications in PRIVATE-channels with the app in background. I don´t know if the notification is on PRESENCE-channel but here it is normal I am using the lib AppState from React-Native to follow the state of the the app https://reactnative.dev/docs/appstate image Remembering, my app was tested only on background and not closed, I don´t know if there is a way to receive with the app closed

fbenevides commented 1 year ago

@iamhaaamed, assuming you're using Pusher Channels and not Beams, you should receive events while the app is in the background but not when it's closed because you need to be connected to Pusher to trigger/receive events.

About the background problem, can you please share more context, such as a piece of code or platform you're testing on? As @Kaue-Romero said previously, you should be receiving events normally.

benjamin-tang-pusher commented 1 year ago

Due to the lack of response, I will close this GH issue.