I am using subscriptions and notifications on CloudKit.
let notificationInfoUpdate = CKNotificationInfo()
notificationInfoUpdate.alertBody = "There is something for you"
notificationInfoUpdate.shouldBadge = true
The code bellow seems to be commonsense here on StackOverflow on how to reset the badge number and I applying it to my applicationDidBecomeActive.
application.applicationIconBadgeNumber = 0
//application.applicationIconBadgeNumber = -1
application.cancelAllLocalNotifications()
It is partially working. If I open the application and then close it the badge is gone.
But as soon as I receive another notification the badge goes back to 60 something... instead of starting from 0.
So in fact it is not really reseting it, but just hiding it think. Any idea?