I tried several things and can not imagine reset the number of icons from the notifications received from cloudKit. Has anyone else encountered this problem. Here is what I tried:
1) Set the icon counter locally to 0
application.applicationIconBadgeNumber = 0; (temporarily removes the badge count).
Bad luck...
2) Call the server to clear the icon counter
CKModifyBadgeOperation *oper = [[CKModifyBadgeOperation alloc] initWithBadgeValue:0]; [oper start];
Bad luck...
3) Pull for all changes to notifications and mark them all read
NSMutableArray *array = [NSMutableArray array]; CKFetchNotificationChangesOperation *operation = [[CKFetchNotificationChangesOperation alloc] initWithPreviousServerChangeToken:nil]; operation.notificationChangedBlock = ^(CKNotification *notification) { [array addObject:notification.notificationID]; }; operation.completionBlock = ^{ CKMarkNotificationsReadOperation *op = [[CKMarkNotificationsReadOperation alloc] initWithNotificationIDsToMarkRead:array]; [op start]; }; [operation start];
And again, no luck ...
Any suggestions would be greatly appreciated! Thanks Chris
ios8 push-notification apple-push-notifications cloudkit cksubscription
Chris gokey
source share