Clear_notification not working

Hi,

I tried implementing the new scheme fr notifications and wanted to use clear_notification for my GFs iPhone. Sadly, this doesn’t work at all.
I’m using the same syntax for my android phone with node-red, so it should be working. I even tried the examples given in the Docs in the developer tools:
using:

service: notify.mobile_app_iphone_von_fine
data:
          title: "Motion Detected in Backyard"
          message: "Someone might be in the backyard."
          data:
            tag: "backyard-motion-detected"

Followed by:

service: notify.mobile_app_iphone_von_fine
data:
          message: "clear_notification"
          data:
            tag: "backyard-motion-detected"

But the notification never disappears. The App is up to date. (2021.6)

What can I do to debug?

Unfortunately, clearing notifications on iOS has a gotcha that we can’t work around (without Apple giving us permission, which they declined) – it needs to wake the app and instruct it to clear the notification. If you use the app somewhat regularly, it’ll be fairly reliable, but if you are mostly using it for notifications the system will not grant it permission to be woken up.

Wow. That’s a bummer. Maybe this should be included in the instructions?
So if I open the app on her phone multiple times it will eventually work?

Unfortunately with android, it also began to not work

core-2021.6.6
supervisor-2021.06.6

service: notify.mobile_app_oneplus_a5010
data:
  message: clear_notification
  data:
    tag: MailBox

It does not work with a capital letter, worked before update

tag: MailBox
tag: mailbox
1 Like

You should report this in the Android section of the forums or in the Android repo as an issue.

Yeah, this should be noted. It’s worth mentioning that these limitations are hard to gauge without releasing it (so the actual limitations are still being found out, so thanks for reporting), and I was hoping Apple would grant us the special permission necessary to make it reliable.

I believe launching the app about once per week is all that is necessary to keep iOS launching the app, but I do not know the exact rules enough to say.

Gonna try this out repeatedly throughout the next days!
Thanks for your answer!
Any way to emphasize the need towards apple? I guess everything is happening in private and there is no “ticker” where we could chime in?

Unfortunately the request is private, yeah. I plan to submit it again hopefully with a more compelling case because, imo, we absolutely qualify for the use case the special permission is designed around.

1 Like

Would be so great! Good luck and thanks!

Damn. Well at least I know I’m not going crazy now. :confused:

It’s been working consistently on my iPad, but not on my iPhone. I use my HA app consistently though on my phone, so I’m still not sure why its not working…

Late reply but the clear_notification DOES work… but only if you are in your local Wifi and if you activate Local Push in the App!

2 Likes

I think this PR will also make it available while using remote push notifications: Mark 'clear_notification' message as background notification on iOS by Cyberbeni · Pull Request #102 · home-assistant/mobile-apps-fcm-push · GitHub

For anyone coming to this I’m finding that even now you can’t use an upper-case first letter. After reading this message by Madman I tried forcing the tag to lower-case (in fact I actually just went to kebab case) and it solved my issue!