applicationIconBadgeNumber in UILocalNotification doesn't work like it should

Originator:mail.junjie
Number:rdar://8571483 Date Originated:20-Oct-2010 09:40 AM
Status:Duplicate/7849640 Resolved:
Product:iPhone SDK Product Version:4.0-4.2beta
Classification:Other Bug Reproducible:Always
 
Summary:
With iOS4, developers can choose to update the application icon badge by scheduling a UILocalNotification and setting its property applicationIconBadgeNumber.

According to the Discussion section of the documentation:
"The default value is 0, which means "no change.” The application should use this property’s value to increment the current icon badge number, if any."

This seem to suggest that applicationIconBadgeNumber can at least add on to any existing value on the icon badge, if any. However this is not so.

The applicationIconBadgeNumber, when set to any number, will override any existing badge number without regard for existing value.

So a developer cannot set applicationIconBadgeNumber of an UILocalNotification to 1 and expect iOS to increment the existing badge count by 1.

Steps to Reproduce:
N/A

Expected Results:
N/A

Actual Results:
N/A

Regression:
N/A

Notes:
Developers resort to scheduling a duplicate set of UILocalNotification with no alertBody and soundName just to update the badge icon without wiping out any existing value on the badges.

The first problem that this causes is that it uses up twice as many local notifications, which already has a maximum limit of 64.

The second problem is that this requires developers to maintain their own count internally so that they can update the badges with the absolute number to be shown on the icon.

The workaround is counter-intuitive when iOS could have just increment or even decrement the badge icon by the applicationIconBadgeNumber property.

This should have been the correct behaviour according to the write up in the documentation anyway, so I have reason to believe that this implementation is buggy and should be resolved.

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!