application:didReceiveRemoteNotification:userInfo:fetchCompletionHandler: not called when opening app from notification

Originator:radexpl
Number:rdar://28493732 Date Originated:27-Sep-2016 02:35 PM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 10
Classification:UI/Usability Reproducible:Always
 
Summary:

When opening an app from a notification (and the app is already running in background), application:didReceiveRemoteNotification:userInfo:fetchCompletionHandler: will not be called.

Steps to Reproduce:
1. Add a `application:didReceiveRemoteNotification:userInfo:fetchCompletionHandler:` method to your UIAppDelegate
2. Open the app, then close it (let it run in background)
3. Have a push notification appear
4. Tap the notification to open the app with it

Expected Results:
- `application:didReceiveRemoteNotification:userInfo:fetchCompletionHandler:` will be called with the notification info.

Actual Results:
- Nothing happens

Regression:
- This is a regression from iOS 9
- `application:didReceiveRemoteNotification:userInfo:fetchCompletionHandler` is called just fine for background pushes, just not when app is opened from a notification
- UNUserNotification API for this seems to work

Notes:

Workaround is to *also* implement `application:didReceiveRemoteNotification:userInfo:` method. Then this one will be called when opening app from a notification, and the variant with the fetch completion handler will be called for background pushes.

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!