Android 8 (Oreo) support & state of repo
See original GitHub issueFirst off, as a fellow open source maintainer, I’d like to thank @zo0r @npomfret (and everyone) for the job they did in maintaining this library for a long time but (and trust me I’m sorry about this) right now this repo is basically abandoned; nobody answers issues nor reviews PRs nor updates the lib since months.
Please, allow new blood to jump in and keep the library at least maintained if not actively developed upon. Or transfer it to somebody else. Push notifications are a core feature for many react native apps and it’s not good to rely on a fork. I suggest you ask to the React Native Community to at least take it over so that other people can help with it.
That said, I’m using react-native 0.49
and build tools 26
and when I tried our prod app on an Android 8 device, when I set up the push notifications in the app a toast message appears:
developer warning for package <app_name> failed to post notification on channel null see log for more details
By doing a quick search it looks like in Android O:
Starting in Android 8.0 (API level 26), notification channels allow you to create a user-customizable channel for each type of notification you want to display. Notification channels provide a unified system to help users manage notifications. When you target Android 8.0 (API level 26), you must implement one or more notification channels to display notifications to your users. If you don’t target Android 8.0 (API level 26) but your app is used on devices running Android 8.0 (API level 26), your app behaves the same as it would on devices running Android 7.1 (API level 25) or lower.
By looking around it shouldn’t be too hard to implement this on the native side:
And no, I cannot move back to lower build tools because of other libs I’m using.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:26
- Comments:24 (2 by maintainers)
Top GitHub Comments
Guys, we faced the same issue in our app. No notifications were showing up on devices with Android 8 on them. It turned out the fix was easy. Just go into your app/build.gradle and switch your targetSdkVersion from 26 to 25. Leave everything else as it is. You don’t have to lower the buildToolsVersion or compileSdkVersion.
@sandropoluan @eyeCU113 @rhysgoehring @kelset
I added your changes in to the Community Edition clone I created of this Library located here: https://github.com/calcazar/react-native-push-notification-CE