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.

Local Notifications not working on Android Oreo (target SDK 26)

See original GitHub issue

Problem: Notifications are working fine on iOS, but when I run the app on my Android device with Oreo I get no notifications and the following error in my logs:

12-08 13:19:23.423 4324 26687 E NotificationService: No Channel found for pkg=com.saferackexample, channelId=null, id=1222192301, tag=null, opPkg=com.saferackexample, callingUid=10196, userId=0, incomingUserId=0, notificationUid=10196, notification=Notification(channel=null pri=1 contentView=null vibrate=[0,300] sound=content://settings/system/notification_sound defaults=0x4 flags=0x10 color=0x00000000 category=call vis=PRIVATE)

compileSdkVersion:` 26, buildToolsVersion: 26.0.02,

build.gradle dependencies:

dependencies {
    compile project(':react-native-push-notification')
    compile(project(':react-native-maps')){
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
      }
    compile project(':react-native-background-geolocation')
    compile(name: 'tslocationmanager', ext: 'aar')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:26.1.0"
    compile "com.facebook.react:react-native:+"  // From node_modules
    
    compile ("com.google.android.gms:play-services-base:11.6.0") {
        force = true;
    }
    compile ("com.google.android.gms:play-services-maps:11.6.0") {
        force = true;
    }
    compile ("com.google.android.gms:play-services-gcm:11.6.0") {
        force = true;
    }
    compile ("com.google.android.gms:play-services-location:11.6.0") {
        force = true;
    }
}

I installed the package exactly as described in the repo and I’m only looking to use local notifications in my app. Has anyone come across this or have a possible solution?

Thank you very much for your assistance.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
adamjacobcommented, Jan 30, 2018

For anyone else struggling with this. I got around this issue by downgrade my target sdk version to 25. Not ideal but works until a proper fix is merged in.

In app/build.gradle

...
targetSdkVersion 25
...
3reactions
mtizianocommented, Jan 11, 2019

For Android Oreo support on localNotification, I added these lines in manifest

<application ... >

    <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"/>

    <!-- Change the resource name to your App's accent color - or any other color you want -->
    <meta-data  android:name="com.dieam.reactnativepushnotification.notification_color"
        android:resource="@android:color/white"/>

    ...

as mentioned in localNotificationSchedule configuration here

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Notification not showing in Oreo - Stack Overflow
In Android O it's a must to use a channel with your Notification Builder ... Also you need to use channels only if...
Read more >
Create and Manage Notification Channels - Android Developers
Starting in Android 8.0 (API level 26), all notifications must be assigned to a channel. For each channel, you can set the visual...
Read more >
THIS Is How You Use Notifications on Android API ... - YouTube
To be able to show notifications on API level 33+, users now need to accept a permission before. In this video I'll show...
Read more >
KMS – How to Resolve Offline Push Notifications
Offline Push notifications is not working in Android Oreo devices when the app is in ... make sure the Android-SDK 26 (API) is...
Read more >
Channel Id In Notification Android
Currently local notifications on android api 26 are not working because we are not populating the channelId Example of code on JS land...
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