Old method
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:count];
is now gives error Attempting to badge the application icon but haven't received permission from the user to badge the application
.
Then I tried to use new API (that I'm think is related to badge value)
CKModifyBadgeOperation * operation = [[CKModifyBadgeOperation alloc] initWithBadgeValue:50]; [operation setModifyBadgeCompletionBlock:^(NSError *error) { NSLog(@"%@", error); }]; [operation start];
But I'm receiving error <CKError 0x165048a0: "Not Authenticated" (9/1002); "This request requires an authenticated account">
How to set badge or receive some new permissions?
In addition to Daij-Djan's answer: it's possible to stack the enums so you can request them all at once. Like follows:
UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
Debug output mentions I should ask for Application Badge permission
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With