Whilst all current answers to this question indicate the depreciation of CKModifyBadgeOperation, all of them had advised up until 2022 that it could still be used due to Apple not having a replacement Api. Upon running the following code:
let badgeReset = CKModifyBadgeOperation(badgeValue: 0)
badgeReset.modifyBadgeCompletionBlock = { (error) -> Void in
if error != nil {
print("Error resetting badge: (error!)")
}
}
CKContainer.default().add(badgeReset)
When run I receive the following error:
Error resetting badge: <CKError 0x3001ddf50: “Invalid Arguments” (12/1017); “CKModifyBadgeOperation is no longer supported”>
And from testing following this, the badge count incrementation issue continues, indicating that this has been completely invalidated and cannot be used at all.
I’m aware of the proposed “workaround” of creating an extension that manually keeps track of notification count & sets the badge accordingly when a notification is received. However I’m trying to ascertain if as of this current point in time there is now no way whatsoever to clear the badge count on the Cloudkit sever level?