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)
- I schedule the local notification to trigger in 15s
- I put the phone to sleep via the power button
- After 15 seconds nothing happens
- After 2 minutes I hear the notification sound, but the screen does not wake up
- 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.