androidreact-nativepush-notificationonesignalreact-native-onesignal

React Native Firebase - Android 10 notification does not appear after a while


By the way: I am not sure that is about Android version but my Android 9 device is working correctly, not working on Android 10

Notifications work for other cases (ex: when app is active or background)

The problem is: when app is waiting on background and phone is locked for 7-10 minutes, notification does not appear.

After unlocking the phone notification appear correctly


Solution

  • I thought the problem is phone is sleeping after a while, so used a foreground notification service library to keep phone awake and solved issue with this workaround. I hope this helps: https://www.npmjs.com/package/@supersami/rn-foreground-service

    and there is a documentation for this package: https://javascript.plainenglish.io/react-native-foreground-service-f7fc8e617fba

    Please comment if you have questions, I would like to help.