ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
124 stars 111 forks source link

Push notification not received when app is closed in android #260

Closed dipti-samyak closed 2 years ago

dipti-samyak commented 2 years ago

Hello, I am facing an issue with push notification in android app. Push notification not received when app is closed. It is working well when app is in background.

Can anyone please help me with this issue?

Thank you in advance.

ccvlad commented 2 years ago

Hello, @dipti-samyak !

Would be helpful if you show logs where are you getting push notification in background mode.

dipti-samyak commented 2 years ago

``Hello @ccvlad

Note that we are using local notification for getting notification in android.

ccvlad commented 2 years ago

Note that we are using local notification for getting notification in android.

You can't display localNotification if app is closed. You should configure and use push notification.

Are you using react-native-push-notification or react-native-firebase? Refer to guide one of those libs

Check our docs - https://developers.connectycube.com/reactnative/push-notifications Our sample RNchat with push notification - https://github.com/ConnectyCube/connectycube-reactnative-samples/tree/master/RNChat

UmerQur3shi commented 2 years ago

@ccvlad I'm having the same issue and I'm using react-native-push-notification, everything is configured according to your docs and the code is same as you provided in the example. When the App is open I get silent data as notification, no popup no sound, I had to create a localNotification in my onNotification method to display it. And when the app is killed, I don't get any notification.

NIDHINgl commented 2 years ago

@ccvlad, we are also facing the same issue, I followed the same code base and document but the notification is not receiving, Notification received only if trigger from local.

Note that we are using local notification for getting notification in android.

You can't display localNotification if app is closed. You should configure and use push notification.

Are you using react-native-push-notification or react-native-firebase? Refer to guide one of those libs

Check our docs - https://developers.connectycube.com/reactnative/push-notifications Our sample RNchat with push notification - https://github.com/ConnectyCube/connectycube-reactnative-samples/tree/master/RNChat

andybui090 commented 2 years ago

I have checked code, with new firebase version, please help remove priority: "high" and contentAvailable from backend if has any to work android, I think this issues related with that or update firebase version

DaveLomber commented 2 years ago

@dipti-samyak @andybui090 @UmerQur3shi @NIDHINgl

guys, the issue is addressed in new MR https://github.com/ConnectyCube/connectycube-reactnative-samples/pull/296

Please read the details and provide a feedback/comments if any