iosobjective-cuilocalnotificationios9.2

iOS 9.2.1, cancel notifcation not working


I'm developing an app having local notification scheduled. I'm not able to cancel the scheduled notification using the code:

UIApplication *app=[UIApplication sharedApplication];  
[app cancelLocalNotification:notification];

The code is working well in previous iOS versions, but it is stopped working in iOS 9.2.1 update.

Can anyone please help me to sort out the issue?


Solution

  • There is a bug in iOS 9.2.1, so cancelLocalNotification methods doesn't work sometimes. Use cancelLocalAllNotifications and update your logic accordingly. This should work.