单击通知后,所有通知都会被清除。在ios中,是否有任何选项可以在点击通知后清除单个通知?我收到了 4 条通知。现在我需要单独点击的通知来清除并保留其他通知。有人可以帮我吗?
- (void) clearNotifications {
[[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0];
[[UIApplication sharedApplication] cancelAllLocalNotifications];
}
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo
{
NSLog(@"Received notification: %@", userInfo);
[self clearNotifications];
}