HTML5 notifications aren't delivered when phone screen is turned off

For few weeks, HTML5 push notifications haven’t been delivered to my phone when the screen is off. Earlier, it worked so that when I turned on the screen then the overdue notifications were delivered. Currently, overdue notifications are lost - they are never delivered. All services that save energy and optimize the battery have been turned off on my phone. I don’t know if this is an isssue in Firebase or in the phone software. I use OnePlus 6 with Android 9 and mobile Chrome. Other people on the Polish Home Assistant forum on Facebook report the same problem on different phones (OnePlus, LG, Huawei). Does anyone have an idea how to fix it? Do you have that problem?

I don’t have a solution for you, but I will just say that I had the same struggles with inconsistent HTML5 notifications. I ended up ditching HTML5 and switching to use a Telegram bot, and I’ve been very happy with that.

I suspect this would be an issue with the phone, given those brands I assume you are using Android. Around Android Pie, they stepped up their power saving features whilst screen off by more aggressively implementing ‘Doze’. From Pie onwards, I had to completely disable Doze to get notifications on most applications when a sleep.

Doze will only allow push notifications from their new Firebase Messaging API, and not the old methods. Their simple fix is of course to upgrade the app to use Firebase Messaging, but thats not practical for people whom arent the author of the app.

You can disable Doze using with ADB using ‘adb shell dumpsys deviceidle disable’. This however is not persistant across reboots. If you have root you could create a boot script to disable it, or you’d need to do it everytime you start the phone.

But I use FCM notifications (not old GCM) and a few weeks ago everything worked well despite the working Doze. Something has changed but I have no idea what.

I have the exact same issue. Also using FCM notifications on Android 9, OnePlus 6

I have the same issue, and have Huawei phone, which i believe implement aggressive power saving.