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.0 notification problem

See original GitHub issue

Notifications not appearing in the foreground or making the phone vibrate when received.

Your Environment

  • Plugin version: 0.9.0-beta.0
  • Platform: android
  • OS version: 8.0.0
  • Device manufacturer / model: Google Pixel
  • Cordova version (cordova -v): 7.1.0
  • Cordova platform version (cordova platform ls): 6.3.0
  • Plugin config: { foreground: true, vibrate: true }
  • Ionic Version (if using Ionic) N/A

Expected Behavior

Notification pops from the top and phone vibrates.

Actual Behavior

Notification triggered, makes a noise but doesn’t pop up in the foreground or vibrate.

Steps to Reproduce

Just schedule a notification with foreground: true and vibrate: true as options.

    window.cordova.plugins.notification.local.schedule({
      text: 'Notification text',
      foreground: true,
      vibrate: true
    }

Context

Notify 😄

Debug logs

11-13 15:53:49.239 7804 7804 W GCM-DMM : Force release of GOOGLE_C2DM lock 11-13 15:53:54.357 892 934 E BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=271636697 mSleepTimeMs=15202 mIdleTimeMs=-93 mTxTimeMs[]=[3, 2, 70, 149, 102] mRxTimeMs=5725 mEnergyUsed=0} 11-13 15:54:01.371 32564 19563 W Notification: Use of stream types is deprecated for operations other than volume control 11-13 15:54:01.371 32564 19563 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case 11-13 15:54:01.383 32564 32564 D CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent(“trigger”,{“title”:“Title”,“text”:“Design team meeting”,“foreground”:true,“lockscreen”:true,“actions”:[],“attachments”:[],“autoClear”:true,“defaults”:0,“groupSummary”:false,“id”:0,“launch”:true,“led”:true,“number”:0,“priority”:1,“progressBar”:{“enabled”:false,“value”:0,“maxValue”:100,“indeterminate”:false},“showWhen”:true,“silent”:false,“smallIcon”:“res://icon”,“sound”:true,“trigger”:{“type”:“calendar”},“vibrate”:false,“wakeup”:true,“meta”:{“plugin”:“cordova-plugin-local-notifications”,“version”:“0.9-beta”}},{“event”:“trigger”,“foreground”:false,“queued”:false,“notification”:0})) 11-13 15:54:01.385 32564 32564 D CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent(“add”,{“title”:“Title”,“text”:“Design team meeting”,“foreground”:true,“lockscreen”:true,“actions”:[],“attachments”:[],“autoClear”:true,“defaults”:0,“groupSummary”:false,“id”:0,“launch”:true,“led”:true,“number”:0,“priority”:1,“progressBar”:{“enabled”:false,“value”:0,“maxValue”:100,“indeterminate”:false},“showWhen”:true,“silent”:false,“smallIcon”:“res://icon”,“sound”:true,“trigger”:{“type”:“calendar”},“vibrate”:false,“wakeup”:true,“meta”:{“plugin”:“cordova-plugin-local-notifications”,“version”:“0.9-beta”}},{“event”:“add”,“foreground”:false,“queued”:false,“notification”:0})) 11-13 15:54:01.445 728 13690 D NuPlayerDriver: NuPlayerDriver(0xf43b22a0) created, clientPid(1443) 11-13 15:54:01.464 728 20145 D GenericSource: FileSource remote 11-13 15:54:01.482 728 20143 D NuPlayerDriver: notifyListener_l(0xf43b22a0), (1, 0, 0, -1), loop setting(0, 0) 11-13 15:54:01.488 892 911 I MediaFocusControl: AudioFocus requestAudioFocus() from uid/pid 10042/1443 clientId=android.media.AudioManager@95afbb3 req=3 flags=0x0 11-13 15:54:01.991 728 13690 D NuPlayerDriver: start(0xf43b22a0), state is 4, eos is 0 11-13 15:54:01.992 728 20143 I GenericSource: start 11-13 15:54:02.008 728 20155 I OMXClient: Treble IOmx obtained 11-13 15:54:02.010 738 25343 I OMXMaster: makeComponentInstance(OMX.google.vorbis.decoder) in omx@1.0-service process 11-13 15:54:02.019 738 25343 E OMXNodeInstance: setConfig(0xf07a2f00:google.vorbis.decoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001) 11-13 15:54:02.019 728 20155 I ACodec : codec does not support config priority (err -2147483648) 11-13 15:54:02.020 738 25343 E OMXNodeInstance: getConfig(0xf07a2f00:google.vorbis.decoder, ConfigAndroidVendorExtension(0x6f100004)) ERROR: Undefined(0x80001001) 11-13 15:54:02.020 728 20155 I MediaCodec: MediaCodec will operate in async mode 11-13 15:54:02.023 647 647 W /system/bin/hw/android.hidl.allocator@1.0-service: ashmem_create_region(32768) returning hidl_memory(0x6ffe02c330, 32768) 11-13 15:54:02.054 647 647 I chatty : uid=1000(system) allocator@1.0-s identical 10 lines 11-13 15:54:02.055 647 647 W /system/bin/hw/android.hidl.allocator@1.0-service: ashmem_create_region(32768) returning hidl_memory(0x6ffe02c330, 32768) 11-13 15:54:02.061 728 20153 D AudioTrack: Client defaulted notificationFrames to 12000 for frameCount 24000 11-13 15:54:02.064 647 647 W /system/bin/hw/android.hidl.allocator@1.0-service: ashmem_create_region(3840) returning hidl_memory(0x6ffe02c330, 3840) 11-13 15:54:02.068 647 647 W /system/bin/hw/android.hidl.allocator@1.0-service: ashmem_create_region(3840) returning hidl_memory(0x6ffe02c330, 3840) 11-13 15:54:02.072 728 20143 D NuPlayerDriver: notifyListener_l(0xf43b22a0), (6, 0, 0, -1), loop setting(0, 0) 11-13 15:54:02.073 648 2231 I ACDB-LOADER: ACDB AFE returned = -19 11-13 15:54:02.073 648 2231 D hardware_info: hw_info_append_hw_type : device_name = speaker 11-13 15:54:02.073 648 2231 D audio_hw_primary: enable_snd_device: snd_device(2: speaker) 11-13 15:54:02.073 648 2231 D audio_hw_primary: enable_audio_route: usecase(1) apply and update mixer path: low-latency-playback speaker 11-13 15:54:02.074 748 764 E ANDR-PERF-OPTSHANDLER: Warning: Resource [2, 0] not supported for core 1. Instead use resource for core 0 11-13 15:54:02.074 748 764 E ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 2, 0] 11-13 15:54:02.959 728 20154 I NuPlayerDecoder: [audio] saw output EOS 11-13 15:54:03.210 728 20153 D AudioTrack: stop() called with 63704 frames delivered 11-13 15:54:03.518 728 20143 D NuPlayerDriver: notifyListener_l(0xf43b22a0), (2, 0, 0, -1), loop setting(0, 0) 11-13 15:54:03.520 892 1912 I MediaFocusControl: AudioFocus abandonAudioFocus() from uid/pid 10042/1443 clientId=android.media.AudioManager@95afbb3 11-13 15:54:06.558 648 1035 D audio_hw_primary: disable_audio_route: usecase(1) reset and update mixer path: low-latency-playback speaker 11-13 15:54:06.561 648 1035 D hardware_info: hw_info_append_hw_type : device_name = speaker 11-13 15:54:06.562 648 1035 D audio_hw_primary: disable_snd_device: snd_device(2: speaker)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
stevesumcommented, Nov 13, 2017

try the priority: 1 option on schedule.

According the spec: “A notification that is at least PRIORITY_HIGH https://developer.android.com/reference/android/app/Notification.html#PRIORITY_HIGH is more likely to be presented as a heads-up notification.”

Of course the priority is get deprecated in API level 26 and will replaced by importance (just to be easy to maintain the things…)

2017-11-13 16:57 GMT+01:00 Drasek notifications@github.com:

Notifications not appearing in the foreground or making the phone vibrate when received. Your Environment

  • Plugin version: 0.9.0-beta.0
  • Platform: android
  • OS version: 8.0.0
  • Device manufacturer / model: Google Pixel
  • Cordova version (cordova -v): 7.1.0
  • Cordova platform version (cordova platform ls): 6.3.0
  • Plugin config: { foreground: true, vibrate: true }
  • Ionic Version (if using Ionic) N/A

Expected Behavior

Notification pops from the top and phone vibrates. Actual Behavior

Notification triggered, makes a noise but doesn’t pop up in the foreground or vibrate. Steps to Reproduce

Just schedule a notification with foreground: true and vibrate: true as options.

window.cordova.plugins.notification.local.schedule({
  text: 'Notification text',
  foreground: true,
  vibrate: true
}

Context

Notify 😄 Debug logs

11-13 15:53:49.239 7804 7804 W GCM-DMM : Force release of GOOGLE_C2DM lock 11-13 15:53:54.357 892 934 E BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=271636697 mSleepTimeMs=15202 mIdleTimeMs=-93 mTxTimeMs[]=[3, 2, 70, 149, 102] mRxTimeMs=5725 mEnergyUsed=0} 11-13 15:54:01.371 32564 19563 W Notification: Use of stream types is deprecated for operations other than volume control 11-13 15:54:01.371 32564 19563 W Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case 11-13 15:54:01.383 32564 32564 D CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local. core.fireEvent(“trigger”,{“title”:“Title”,“text”:“Design team meeting”,“foreground”:true,“lockscreen”:true,“actions”:[], “attachments”:[],“autoClear”:true,“defaults”:0," groupSummary":false,“id”:0,“launch”:true,“led”:true," number":0,“priority”:1,“progressBar”:{“enabled”:false, “value”:0,“maxValue”:100,“indeterminate”:false}," showWhen":true,“silent”:false,“smallIcon”:“res://icon”," sound":true,“trigger”:{“type”:“calendar”},“vibrate”:false," wakeup":true,“meta”:{“plugin”:“cordova-plugin-local- notifications”,“version”:“0.9-beta”}},{“event”:“trigger”," foreground":false,“queued”:false,“notification”:0})) 11-13 15:54:01.385 32564 32564 D CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local. core.fireEvent(“add”,{“title”:“Title”,“text”:“Design team meeting”,“foreground”:true,“lockscreen”:true,“actions”:[], “attachments”:[],“autoClear”:true,“defaults”:0," groupSummary":false,“id”:0,“launch”:true,“led”:true," number":0,“priority”:1,“progressBar”:{“enabled”:false, “value”:0,“maxValue”:100,“indeterminate”:false}," showWhen":true,“silent”:false,“smallIcon”:“res://icon”," sound":true,“trigger”:{“type”:“calendar”},“vibrate”:false," wakeup":true,“meta”:{“plugin”:“cordova-plugin-local- notifications”,“version”:“0.9-beta”}},{“event”:“add”," foreground":false,“queued”:false,“notification”:0})) 11-13 15:54:01.445 728 13690 D NuPlayerDriver: NuPlayerDriver(0xf43b22a0) created, clientPid(1443) 11-13 15:54:01.464 728 20145 D GenericSource: FileSource remote 11-13 15:54:01.482 728 20143 D NuPlayerDriver: notifyListener_l(0xf43b22a0), (1, 0, 0, -1), loop setting(0, 0) 11-13 15:54:01.488 892 911 I MediaFocusControl: AudioFocus requestAudioFocus() from uid/pid 10042/1443 clientId=android.media. AudioManager@95afbb3 req=3 flags=0x0 11-13 15:54:01.991 728 13690 D NuPlayerDriver: start(0xf43b22a0), state is 4, eos is 0 11-13 15:54:01.992 728 20143 I GenericSource: start 11-13 15:54:02.008 728 20155 I OMXClient: Treble IOmx obtained 11-13 15:54:02.010 738 25343 I OMXMaster: makeComponentInstance(OMX.google.vorbis.decoder) in omx@1.0-service process 11-13 15:54:02.019 738 25343 E OMXNodeInstance: setConfig(0xf07a2f00:google.vorbis.decoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001) 11-13 15:54:02.019 728 20155 I ACodec : codec does not support config priority (err -2147483648) 11-13 15:54:02.020 738 25343 E OMXNodeInstance: getConfig(0xf07a2f00:google.vorbis.decoder, ConfigAndroidVendorExtension(0x6f100004)) ERROR: Undefined(0x80001001) 11-13 15:54:02.020 728 20155 I MediaCodec: MediaCodec will operate in async mode 11-13 15:54:02.023 647 647 W /system/bin/hw/android.hidl. allocator@1.0-service: ashmem_create_region(32768) returning hidl_memory(0x6ffe02c330, 32768) 11-13 15:54:02.054 647 647 I chatty : uid=1000(system) allocator@1.0-s identical 10 lines 11-13 15:54:02.055 647 647 W /system/bin/hw/android.hidl. allocator@1.0-service: ashmem_create_region(32768) returning hidl_memory(0x6ffe02c330, 32768) 11-13 15:54:02.061 728 20153 D AudioTrack: Client defaulted notificationFrames to 12000 for frameCount 24000 11-13 15:54:02.064 647 647 W /system/bin/hw/android.hidl. allocator@1.0-service: ashmem_create_region(3840) returning hidl_memory(0x6ffe02c330, 3840) 11-13 15:54:02.068 647 647 W /system/bin/hw/android.hidl. allocator@1.0-service: ashmem_create_region(3840) returning hidl_memory(0x6ffe02c330, 3840) 11-13 15:54:02.072 728 20143 D NuPlayerDriver: notifyListener_l(0xf43b22a0), (6, 0, 0, -1), loop setting(0, 0) 11-13 15:54:02.073 648 2231 I ACDB-LOADER: ACDB AFE returned = -19 11-13 15:54:02.073 648 2231 D hardware_info: hw_info_append_hw_type : device_name = speaker 11-13 15:54:02.073 648 2231 D audio_hw_primary: enable_snd_device: snd_device(2: speaker) 11-13 15:54:02.073 648 2231 D audio_hw_primary: enable_audio_route: usecase(1) apply and update mixer path: low-latency-playback speaker 11-13 15:54:02.074 748 764 E ANDR-PERF-OPTSHANDLER: Warning: Resource [2, 0] not supported for core 1. Instead use resource for core 0 11-13 15:54:02.074 748 764 E ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 2, 0] 11-13 15:54:02.959 728 20154 I NuPlayerDecoder: [audio] saw output EOS 11-13 15:54:03.210 728 20153 D AudioTrack: stop() called with 63704 frames delivered 11-13 15:54:03.518 728 20143 D NuPlayerDriver: notifyListener_l(0xf43b22a0), (2, 0, 0, -1), loop setting(0, 0) 11-13 15:54:03.520 892 1912 <(520)%20892-1912> I MediaFocusControl: AudioFocus abandonAudioFocus() from uid/pid 10042/1443 clientId=android.media.AudioManager@95afbb3 11-13 15:54:06.558 648 1035 D audio_hw_primary: disable_audio_route: usecase(1) reset and update mixer path: low-latency-playback speaker 11-13 15:54:06.561 648 1035 <(561)%20648-1035> D hardware_info: hw_info_append_hw_type : device_name = speaker 11-13 15:54:06.562 648 1035 <(562)%20648-1035> D audio_hw_primary: disable_snd_device: snd_device(2: speaker)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/katzer/cordova-plugin-local-notifications/issues/1425, or mute the thread https://github.com/notifications/unsubscribe-auth/ACQrULEovWuO74jVX5N5cm6kdk42W9Osks5s2Gb1gaJpZM4Qb_MU .

0reactions
matamune94commented, Oct 2, 2019

I try your git but it not work. It working with you sir ?

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 >
Issue with Notifications on Android OS 8.0 · Issue #30 · sabrinathai ...
The Google Sheets database shows the notifications are being scheduled correctly, but they are never sent to the user. So far this issue...
Read more >
8.0 oreo - Android 8 delayed notifications
The answer doesn't work lol. Btw, there's no way to fix delayed notifications on my phone. Some device manufactures have aggressive battery ...
Read more >
Oreo notification feature: A critical issue that could restart your ...
This code causes the phone to restart; further investigation revealed that line 8 causes the phone to crash and restart; it will throw...
Read more >
Notifications do not work on Android Oreo - Fitbit Community
A bunch of people who use my Android app that enhances notifications for ... app version 2.57 and notifications are not working on...
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