Ganesh G
Ganesh G

Reputation: 2061

Removing all push notifications from list when i click on one notification

I am implementing an application which is support to apple push notifications.If i get three notifications from apple server then in iphone the notification list is showing three notifications and if i select any one of them am going in to application according to the notification.After if i check in iphone notification list for remaining two notification there were no push notifications to see.The notification list is showing No new notification.

And also my application is universal app. The push notification is working fine in iphone4 and iphone5 with ios6 but not working in ipad1 with ios5.

Please help me.

Thanks in advance.

After select any one(push notification) of them

Upvotes: 2

Views: 2301

Answers (1)

Tieme
Tieme

Reputation: 65479

This method is fired on the App Delegate when the user tabs the notification in Notification Center:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions (NSDictionary *)launchOptions {

    // You could use the following methods calls:

        // To remove the notifications in Notification Center:
        [[UIApplication sharedApplication] cancelAllLocalNotifications];

        // To set the badge (0 is no badge at all):
        [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
}

If you want to remove the notifications as well when the user returns 'normally' without using the notification add the method calls to:

- (void)applicationWillEnterForeground:(UIApplication *)application {
}

I don't think it is possible to just cancel one notification, check out this post for more info.


Did you google this iPad problem yet? I searched a bit and found others with the same problem. It turns out notifications are working on but you don't see them appear on the lockscreen. Check out these topics:

Or try and google a bit: https://www.google.nl/search?q=ipad+1+notification+center

Upvotes: 1

Related Questions