Replies: 3 comments
-
I think being able to clear a given group makes sense, but tag-prefix seems a bit awkward. The former seems like an easy one to accept as a change. You can write and test this in the iOS simulator using |
Beta Was this translation helpful? Give feedback.
-
Had a try of this this afternoon, however I wasn't quite able to trigger the right conditions in the app via simctl to test I tried a handful of payloads, including this one: {
"aps": {
"content-available": 1
},
"homeassistant": {
"command": "clear_notification",
"tag": "test_tag"
}
}
(which I arrived at by working backwards through the iOS app as well as the fixtures in the fcm push repo firing them with the command Perhaps you know the magic to make this work? 😅 edit: Ah a few more breakpoints later, now I think I understand (in |
Beta Was this translation helpful? Give feedback.
-
Ah, darn, the pushes you can do with simctl don't trigger the remote flow. You can probably hook up the command manager to the "didReceiveResponse" delegate callback in NotificationManager so tapping on it triggers the command, for testing. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Currently, to use
clear_notification
, you must use thetag
to create a named identifier for the notification. This however, causes subsequent notifications with the same tag to replace the original due to ReplacingMy use case is that I would like to be able to clear an entire group of notifications without needing to keep track of the specific tags given to these and have to keep track of a set of tags to call
clear_notification
on.Ideally I would dynamically send each notification with
Describe the solution you'd like
Ideally there would be an extension of the
clear_notifications
API:Currently this is handled by this code:
iOS/Sources/Shared/Notifications/NotificationCommands/NotificationsCommandManager.swift
Lines 80 to 84 in 1db6f3c
which I expect could be extended to call
getDeliveredNotifications(completionHandler:)
to retrieve the notification and their identifiers, and match them against the prefix and subsequently remove themAdditional context
I am not an iOS eng but happy to have a crack at this if there is a chance this would be accepted as a feature!
Beta Was this translation helpful? Give feedback.
All reactions