Alternative to UserNotificationCenterDelegate’s willPresent when app is in background

For iOS 10 local notifications your out of luck. For iOS 10 remote notifications —regardless of user interaction you can receive callbacks using application(_:didReceiveRemoteNotification:fetchCompletionHandler:). (It’s kind of confusing that they deprecated most notification related methods but not this one) Callback for when app is in foreground and you’re about to show the notification: func userNotificationCenter(_ … Read more

Delete a particular local notification

You can save a unique value for key in your local notification’s userinfo. Get all local notification, loop through the array and delete the particular notification. Code as follows, OBJ-C: UIApplication *app = [UIApplication sharedApplication]; NSArray *eventArray = [app scheduledLocalNotifications]; for (int i=0; i<[eventArray count]; i++) { UILocalNotification* oneEvent = [eventArray objectAtIndex:i]; NSDictionary *userInfoCurrent = … Read more