Push notification only when i unlock my smartphone

Hi everyone,
i wanted to migrate from telegram to Home Assistant companion notification but i have this problem:

I only received notification when i unlock my phone or a couple of minutes after using it.
I have disabled battery optimisation. It’s a Huawei P20

Did you make sure to use ttl and priority ?

Follow the android example here: https://companion.home-assistant.io/docs/notifications/critical-notifications

1 Like

Ho my god, what a noob… it’s seems to work now. I wasn’t aware of this option…
Many thanks @dshokouhi

So how does the ttl work? I’m wondering what happens if your phone is off or in an area of no service?
Do you get that notification when you turn the phone on or get service again or does the ttl say it is too old and you never get that message?

You will want to read the FCM docs on that https://firebase.google.com/docs/cloud-messaging/concept-options#ttl

Thanks for the link. So for anyone else that doesn’t want to follow the link…" Keep in mind that a time_to_live value of 0 means messages that can’t be delivered immediately are discarded."

So if you use the ttl remember that it is a double edge sword.

1 Like