How to Retrieve Current Badge Count After applicationIconBadgeNumber Deprecation?

Hi Everyone,

I noticed that applicationIconBadgeNumber has been deprecated in iOS17. While there's a new method to set the badge number using setBadgeCount(_:withCompletionHandler:), I couldn't find a way to retrieve the current value.

Previously we used to call UIApplication.shared.applicationIconBadgeNumber, to get the current value, which is deprecated now.

Does anyone know how to get the current badge count?

Thanks!

Answered by Engineer in 810068022

While you should be able to still use the deprecated method until the functionality is removed, we do recommend not relying on the system to keep track of the badge count, and to do so locally in your app or at your server (for push notifications).

If you disagree with this deprecation and would like to suggest an alternative, you can use the Feedback Assistant.

If you have any questions about filing a Feedback report, take a look at Bug Reporting: How and Why?


Argun Tekant /  DTS Engineer / Core Technologies

While you should be able to still use the deprecated method until the functionality is removed, we do recommend not relying on the system to keep track of the badge count, and to do so locally in your app or at your server (for push notifications).

If you disagree with this deprecation and would like to suggest an alternative, you can use the Feedback Assistant.

If you have any questions about filing a Feedback report, take a look at Bug Reporting: How and Why?


Argun Tekant /  DTS Engineer / Core Technologies

How to Retrieve Current Badge Count After applicationIconBadgeNumber Deprecation?
 
 
Q