React-native-onesignal: Not receiving notification when app is killed in android 8.0.0 and above (Oreo).

Created on 3 Aug 2018  ·  4Comments  ·  Source: OneSignal/react-native-onesignal

I'm using react-native onesignal 3.0.5 and react-native 0.53.3.

It's working absolutely fine in almost every platform (Android/IOS) and every situation (Running in Foreground/Background/Killed).

In android version 8.0.0 or above, app doesn't receiving notification or displaying notification while app is killed. I tested it on One Plus 5 and 5T. Other android devices except one plus, it's working fine.
Other apps like whats app, instagram notifications are working fine even app is killed.

I googled it out and i find out a hack I go to Settings> Battery> Battery Optimisation> (Three dots menu on left-top corner) Advanced optimisation > Turn off Advanced optimisation
Here. But this is not general solution.
These are also reference links but i can't get appropriate solution.
https://stackoverflow.com/questions/39504805/android-app-not-receiving-firebase-notification-when-app-is-stopped-from-multi-t/39505298#39505298

https://github.com/evollu/react-native-fcm/issues/933

https://stackoverflow.com/questions/39480931/error-broadcast-intent-callback-result-cancelled-forintent-act-com-google-and

Most helpful comment

@shahchaitanya Unfortunately, there just isn't much we can do about this. With some Chinese devices like the OnePlus, it's not possible to work around this, they will block notifications for apps that explicitly get terminated.

You may want to show a message to users that use these devices (OnePlus, Xiaomi, etc.) but if their OS flavor won't let us run the app, there isn't much we can do about it.

All 4 comments

@shahchaitanya Unfortunately, there just isn't much we can do about this. With some Chinese devices like the OnePlus, it's not possible to work around this, they will block notifications for apps that explicitly get terminated.

You may want to show a message to users that use these devices (OnePlus, Xiaomi, etc.) but if their OS flavor won't let us run the app, there isn't much we can do about it.

@Nightsd01 Yeh I know It's not one signal problem. It's OS Problem. I searched solution but i didn't find workaround. So I posted it here.

@shahchaitanya does your application at least display the pop up asking for the activation of notifications ? Coz, I have a user with a OnePlus 3T on 8.0.0 who doesn't even had the possibilities to say yes or not at the beggining with the pop up alert. Just wanted to know if it was the same problem.

@Nightsd01 How can you say the problem come from the OS when the others applications works well for the notification on his phone... ? 😮

@MayeuldP this will help you. Other application like Facebook and Whatsapp run in background even it's killed.

Was this page helpful?
0 / 5 - 0 ratings