Add ability to clear the apps badge without clearing notification center

Originator:davbeck
Number:rdar://35589208 Date Originated:16-Nov-2017 08:29 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:11.1.1
Classification:UI/Usability Reproducible:Always
 
Summary:
Since push notifications were introduced, iOS has used the heuristic of clearing notifications for an app when it’s badge is set to 0. However, since iOS 10 apps have had the ability to selectively clear notifications more intelligently. It is not always appropriate to clear all notifications when the badge hits 0 and now there exists an alternative that apps can implement.

Steps to Reproduce:
1. Send a push notification with a badge count of 1.
2. Send a second notification with either a badge count of 1 (nothing changed) or omitting the key from the payload entirely. Such content may not be important enough to warrant a badge on the home screen.
3. On the apps backend, mark the first notification’s content as read, setting the services state to 0 and either in a push notification or locally set the badge to 0.


Expected Results:
There should be some way for an app to indicate that it manages clearing notifications itself and does not rely on the legacy behavior of clearing notifications using the badge.

Actual Results:
When setting the badge to 0, all notifications are cleared (the second one included in the repro steps).

Version:
11.1.1

Notes:
There is a workaround, which is to set the badge to -1. Doing so clears the badge from the app but does not clear notifications. While this seems to have worked from iOS 8-11, it is undocumented behavior.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!