老方法
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:count];
Run Code Online (Sandbox Code Playgroud)
现在给出了错误Attempting to badge the application icon but haven't received permission from the user to badge the application.
然后我尝试使用新的API(我认为这与徽章价值有关)
CKModifyBadgeOperation * operation = [[CKModifyBadgeOperation alloc] initWithBadgeValue:50];
[operation setModifyBadgeCompletionBlock:^(NSError *error) {
NSLog(@"%@", error);
}];
[operation start];
Run Code Online (Sandbox Code Playgroud)
但是我收到了错误 <CKError 0x165048a0: "Not Authenticated" (9/1002); "This request requires an authenticated account">
如何设置徽章或获得一些新权限?
ios8 ×1