For iOS 10, will application:didReceiveRemoteNotification:fetchCompletionHandler: still be called when app is in background? Or we need to implement something new.

Hi,

I am trying to make our app's push notification work on iOS 10 and have found application:didReceiveRemoteNotification:fetchCompletionHandler: won't be called when app is in background with xcode 8. The new function from UNUserNotificationCenterDelegate:

func userNotificationCenter(UNUserNotificationCenter, willPresent: UNNotification, withCompletionHandler: (UNNotificationPresentationOptions) -> Void) looks like only for a foreground app. So how could we handle the app background case?

Besides this, does anyone know how to make the new two functions for receiving notifications and handling the selections of custom actions to be called in xcode? My breakpoint didn't work with them.


Thanks!

Replies

make sure you set the UNUserNotificationCenter.current().delegate = self in didReceiveRemoteNotification

Solved a lot problems that I was facing! Thanks a ton for taking the time to write it here!

Is this thread applicable for iOS 10.3? iOS 11? I am trying to plan notifications and want to know if I need to consider the things you have talked about in this thread!