Clearing a notification

Is there a way to clear/remove a notification in iOS like there is in Android?
(see here for Android instructions - if you pass clear_notification with the same tag, the notification is cleared)

I am also interested in this, it is possible in apns to delete a notification with the know id and I tried a couple variations of trying to shove del-id into the current service. Started reading through some of the notify code on both core and mobile app side but have not found anything yet, literally just started my journey this morning. Here is a quick primer I found on removing notifications

Edit: After reading through the link I posted a few more times I miss-took del-id as an apple internal header/flag, but looks like something the author implemented in his example to catch an id to pass to the delete service… I am not a mobile developer so I did not get far combing through the iOS companion source code. I guess it’s time to read up on Swift

Edit 2: HA so there is already a pull request for this in the repo and the user even references the same blog post I did, will need to keep an eye on this.

1 Like

That’s great news. I hope we get to enjoy it soon, but I believe the release schedule for the iOS app is pretty infrequent.

Its been several months since the last post - any news on this?

I would really like the user experience to be the same on both devices

Right now I change the message from an actionable notification to a standard one with just a message.

A good example of a use case for this is a garage door. I send a actionable notification to android and iOS devices when the garage door has been open for 30 mins (with a CCTV camera snapshot showing the garage door) so the user can see and close if required.

If the garage door is then closed manually (ie by a normal garage remote and not by the devices), then I would want to see notifications on both devices disappear.

There is no built in mechanism to recall notifications on iOS - the one way we can do it will require: 1. we move off Firebase so we can control the push ID ourselves, 2. storing the push ID somewhere so you can use the identifier to recall it, 3. adding some app code to update the move based on ID.

This is a big change (moving off Firebase) that we wish to do, requires client side changes to make removing existing notifications work (and I am not 100% sure this part even works).

For now, using collapse to replace the existing notification (which I think is what you’re doing) is the best possibility. I do this to replace e.g. “water leak detected!” with “water leak alert resolved” which is unfortunate clutter but at least can get the message across.