Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230458

(Android) Capacitor Local Notifications Issues. Scheduled Notifications only ever are delivered when the phone screen is on/active

$
0
0

I am facing the same issue (Capacitor 4 + Android SDK 32 + plugin version 4.1.4).

It’s even a bit weirder. The following happens on all my phones:

  • Xiaomi Mi 9T (Android 11)
  • Sony Xperia 5 (Android 11)
  • Samsung Galaxy S8 (Android 9)
  1. I schedule the local notification to trigger in 15s
  2. I put the phone to sleep via the power button
  3. After 15 seconds nothing happens
  4. After 2 minutes I hear the notification sound, but the screen does not wake up
  5. When I turn on the screen the notification message is there

If after 3., I turn on the screen, the notification sound and the message appear immediately.

My channel is created via:

Capacitor.Plugins.LocalNotifications.createChannel({
    id: '1',
    name: 'channel_name',
    description: 'channel_description',
    importance : 5,
    visibility: 1,
    vibration: true,
    sound: 'sound_name.wav'
})

And the notification is scheduled via:

Capacitor.Plugins.LocalNotifications.schedule({notifications: [
    {
        channelId: '1',
        id: 0,
        title: 'notification_title',
        body: 'notification_body',
        schedule : {at: new Date(Date.now() + 15000)}
    }
]})

allowWhileIdle: true has no effect.


Viewing all articles
Browse latest Browse all 230458

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>