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.

Notifications stop displaying on Android 8 and 8.1

See original GitHub issue
  1. React-Native version 0.51, react-native-fcm version (14.1.2 sdk-26 branch)
  2. Nokia 8 (Android 8.1) and Nokia 7 Plus (Android One 8.0.0)
  3. App is not running or running in background (user bug report, user was not sure)
  4. Firebase version 11.8.0

Hi,

I have an an released with react-native-fcm, and I’m getting user reports that notifications work for a while, then just stop. I finally managed to get a log report of one of the incidents, and the message that comes up is this:

05-07 17:18:01.849 27551 27551 W GCM     : broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000000 pkg=to.synced.synced (has extras) }

Once the message comes up, it continues coming, and no further notifications arrive

Googling around it seems this crops up most often when the app is force killed by a battery saving mechanism more common in phones like the OnePlus 3T.

But in this case there is no battery saving being applied, at some point this message pops up and the notifications stop (along with the foreground service the app runs while it is closed).

I’ve also tried the same code on Android 5.1 and it runs without issue

I’m using custom notifications for Android, with the following format

{
            "custom_notification": {
                "channel":"default",
                "id":id,
                "number": number,
                "body": body,
                "big_text": body,
                "title": title,
                "icon":"ic_notif",
                "priority":"high",
                "sound":"default",
                "show_in_foreground": showinfg
                }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tss101commented, May 9, 2018

Digging through the logs I did come across this. Is number supposed to be a float?

05-07 22:57:01.280  6508  9943 W Bundle  : Key number expected Double but value was a java.lang.Integer.  The default value 0.0 was returned.
05-07 22:57:01.281  6508  9943 W Bundle  : Attempt to cast generated internal exception:
05-07 22:57:01.281  6508  9943 W Bundle  : java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double
05-07 22:57:01.281  6508  9943 W Bundle  :      at android.os.BaseBundle.getDouble(BaseBundle.java:1069)
05-07 22:57:01.281  6508  9943 W Bundle  :      at android.os.BaseBundle.getDouble(BaseBundle.java:1051)
05-07 22:57:01.281  6508  9943 W Bundle  :      at com.evollu.react.fcm.SendNotificationTask.doInBackground(SendNotificationTask.java:77)
05-07 22:57:01.281  6508  9943 W Bundle  :      at com.evollu.react.fcm.SendNotificationTask.doInBackground(SendNotificationTask.java:36)
05-07 22:57:01.281  6508  9943 W Bundle  :      at android.os.AsyncTask$2.call(AsyncTask.java:333)
05-07 22:57:01.281  6508  9943 W Bundle  :      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
05-07 22:57:01.281  6508  9943 W Bundle  :      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
05-07 22:57:01.281  6508  9943 W Bundle  :      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
05-07 22:57:01.281  6508  9943 W Bundle  :      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
05-07 22:57:01.281  6508  9943 W Bundle  :      at java.lang.Thread.run(Thread.java:764)

0reactions
tss101commented, May 16, 2018

Many thanks @evollu!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Notifications Not Showing Up? 10 Fixes You Can Try
Not seeing notifications show up on your Android phone? Try these fixes to get Android notifications working again.
Read more >
How To Turn Off Notifications Android 8.1 Oreo - BestusefulTips
Step 1: Go to Settings in your Android Oreo. Step 2: Tap on Apps & notifications. List of installed apps views in your...
Read more >
How to Disable Persistent Notifications in Android 8.1 Oreo
Open “Settings” and go to “Apps & notifications”. · Press the 'See all apps' option to view the list of installed apps. ·...
Read more >
Control notifications on Android - Google Support
Open your phone's Settings app. · Tap Apps & notifications and then Notifications. · Under "Lock screen," tap Notifications on lock screen or...
Read more >
How to turn off notifications in Android 11 and older
1. Swipe down from the top to expand the Notification Shade. 2. Long-press on the notification. If you’re trying to silence Gmail, for...
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