当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - Objective c how to keep other notifications on the notification tray after taping one notification

问题描述:

For my iOS application,

I've received local notifications its working fine.

When the app is in Background, these notifications go to Notification Tray, stay there until I see those notifications.

But here i have issue as follows,

At 6.00AM I have received 5 local notifications, all these 5 are staying under notification tray... But when I tap any one of these 5 all the other 4 notifications (notification of my project) under Notification Tray are also cleared.

I don't have any clue on what it does...

What I need to do to keep the other notification in Tray only?

My code in

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification

{

NotificationAlertView * localNotificationAlert = [[NotificationAlertView alloc] initWithTitle:APP_TITLE message:notification.alertBody delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];

localNotificationAlert.notifcation = notification ;

localNotificationAlert.tag =ALERT_SURVEY_NOTIFICATION_TAG;

[localNotificationAlert show];

application.applicationIconBadgeNumber = 0;

// Set icon badge number to zero

application.applicationIconBadgeNumber = 0;

notification.applicationIconBadgeNumber = 0;

}

网友答案:
application.applicationIconBadgeNumber = 0;

has side effect.You should set it properly.

网友答案:

In notification tray, if you tap on any notification, other notifications of the same app will automatically cleared from the tray. This is the default behaviour of iOS, you can't change it.

分享给朋友:
您可能感兴趣的文章:
随机阅读: