Macos 获取用户';s NSUserNotificationCenter
我正在开发一个接收推送通知的Mac应用程序,我希望保持徽章号与用户通知中心中的消息数同步Macos 获取用户';s NSUserNotificationCenter,macos,push-notification,badge,Macos,Push Notification,Badge,我正在开发一个接收推送通知的Mac应用程序,我希望保持徽章号与用户通知中心中的消息数同步 NSMutableArray *allNotifications = [NSMutableArray array]; [allNotifications addObjectsFromArray:[[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]]; [allNotifications addObj
NSMutableArray *allNotifications = [NSMutableArray array];
[allNotifications addObjectsFromArray:[[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]];
[allNotifications addObjectsFromArray:[[NSUserNotificationCenter defaultUserNotificationCenter] scheduledNotifications]];
当我轮询NSUserNotificationCenter的已传递和计划通知时,我收到0个对象,尽管我的通知中心中有2条可见消息
NSMutableArray *allNotifications = [NSMutableArray array];
[allNotifications addObjectsFromArray:[[NSUserNotificationCenter defaultUserNotificationCenter] deliveredNotifications]];
[allNotifications addObjectsFromArray:[[NSUserNotificationCenter defaultUserNotificationCenter] scheduledNotifications]];
是否有不同的推送通知通知中心