handleActionWithIdentifier called instead of didReceiveRemoteNotification when app is running but not in foreground

Originator:bcriscuolo
Number:rdar://27194349 Date Originated:06-Jul-2016
Status:Open Resolved:
Product:iOS Product Version:iOS 10 beta 1
Classification:APNS Reproducible:Yes
 
Area:
APNS (Notifications)

Summary:
Environment: iOS 10 beta 1 (14A5261v) on an iPod touch 6th generation

While testing applications build for iOS 8/iOS 9 on the iOS 10 beta, I noticed that when the app is running, but not in the foreground, received push notifications acted upon in Notification Center or via banner display cause application:handleActionWithIdentifier:forRemoteNotification:completionHandler: to be called with an identifier of "com.apple.UNNotificationDefaultActionIdentifier", rather than the iOS 9 SDK behavior of application:didReceiveRemoteNotification: being called.

Due to this change, existing applications will not work correctly under iOS 10 as there is no defined (or known at time of release) identifier for "com.apple.UNNotificationDefaultActionIdentifier".

Additionally, -application:handleActionWithIdentifier.... is documented to be called for defined categories within the payload:

"Tells the app delegate to perform the custom action specified by a remote notification.
The app calls this method when the user taps an action button in an alert displayed in response to a remote notification. Remote notifications that include a category key in their payload display buttons for the actions in the corresponding category"

The method is documented to only fire when there is a specified category, not a default.

Steps to Reproduce:
1. Using an application which supports push categories (registered with UIUserNotificationSettings which include categories) and is registered & provisioned for push notifications

2. Implement application:handleActionWithIdentifier:forRemoteNotification:completionHandler:

3. Implement application:didReceiveRemoteNotification:

4. Send a basic push notification to the device

5. Notice that application:didReceiveRemoteNotification: is not called, but rather application:handleActionWithIdentifier:forRemoteNotification:completionHandler:

Expected Results:
application:didReceiveRemoteNotification: is called (the "default" push handler since UINotifications were first supported.

Actual Results:
application:handleActionWithIdentifier:forRemoteNotification:completionHandler: is called, with an "unknown" (to iOS 8/iOS 9 deployment target apps) identifier of "com.apple.UNNotificationDefaultActionIdentifier".

Version:
 iOS 10 beta 1 (14A5261v)

Notes:


Configuration:
iPod touch 6th generation

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!