question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android >= 8.0 is not receiving notifications

See original GitHub issue

Yesterday I notice that devices that are using an Android version greater than 8.0 were not receiving push notifications. When I was debugging it, I notice that it’s caused by the null value returned by this.config.getChannelName() on the RNPushNotificationHelper.java file.

A workaround that I found was to make a ternary there in order to set a default value to it if it returns null.

NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, this.config.getChannelName() != null ? this.config.getChannelName() : "rn-push-notification-channel", importance);

It’s working but I know that it’s not the best solution for it. Can we improve it? Is there any drawback related to this workaround?

The fork that I’m using with the workaround: https://github.com/rafaelcamaram/react-native-push-notification

Cheers

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:22
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
rafaelcamaramcommented, Nov 15, 2018

Thanks, this saved my life. I suggest you to create a PR, I guess it will be reviewed?

@ebaynaud I’m happy to contribute somehow 😃

I just opened a PR: Pull Request

4reactions
pavermakovcommented, Dec 20, 2018

@rafaelcamaram What stops you from updating the manifest file?

<meta-data  android:name="com.dieam.reactnativepushnotification.notification_channel_name"
                android:value="YOUR NOTIFICATION CHANNEL NAME"/>

<meta-data  android:name="com.dieam.reactnativepushnotification.notification_channel_description"
                    android:value="YOUR NOTIFICATION CHANNEL DESCRIPTION"/>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Notifications Not Showing Up? 10 Fixes You Can Try
Android Notifications Not Showing Up? 10 Fixes You Can Try · 1. Reboot Your Phone · 2. Review the App's Notification Settings ·...
Read more >
Android Notifications Not Working [ 2022 Ultimate Fixes]
From the pop-up window, Tap on Restart.
Read more >
How to Fix Notifications Not Showing up on Android - Lifewire
How to Fix No Notifications on Android · Check That Do Not Disturb is not enabled. · Restart your phone. · Make sure...
Read more >
How to fix Android notifications not working - Carlcare Service
How to fix Android notifications not working · Open your device settings. · Click on 'Apps & Notifications' · Click on 'Manage apps'...
Read more >
Notifications are not shown on Android 8 and 9 - Stack Overflow
I am developing an Android app that includes notifications. I have tried the new Android 8 notification code: NotificationCompat. Builder ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found