Application reports state in iOS 11 as Active when app handles push notification while in Inactive state

Originator:spaus
Number:rdar://34332569 Date Originated:8 September 2017
Status:Open Resolved:
Product:iOS Product Version:11 beta 10 (15A5372a)
Classification:Bug Reproducible:Yes
 
Area:
UserNotifications Framework

Summary:
An app, running on iOS 11, that handles push notifications while in the Inactive state (for example, if the app was Active when the Notification Center drawer is displayed), reports it's state as Active if it handles a push notification in response to a user tapping a notification for that app.

Steps to Reproduce:
The attached sample application reproduces this problem.  It prints the state of the application in application(_:didReceiveRemoteNotification:).  It can be reproduced on iOS 11 by executing the following steps:

1. Run the app.
2. Put the app into the background
3. Send two (or more) unique push notifications to the notification token printed on the console
4. Tap one of them to open the app, 
3. Check the state reported by the app during application(_:didReceiveRemoteNotification:). 
4. Notification Center
5. Tap the second (or another) notification. 
6. Check the state reported by the app during application(_:didReceiveRemoteNotification:). 

Expected Results:
Both steps 3 and 6 above should report Inactive as the app state (this is true on iOS 10.3.3)

Actual Results:
Step 3 reports the application state as Inactive (as expected), but at step 6, the app reports its state as Active.

Version/Build:
iOS 11.0 beta 10 (15A5372a)

Configuration:
Xcode Version 9.0 beta 6 (9M214v)

Affected app:  ApplicationState

Date and Time Issue Occurred:  11:30 AM Central Time 8 September 2017

Comments

Try to upgrade your iPhone to iOS 11.2

This issue is gone when I upgraded my iPhone device from iOS 11.1 to iOS 11.2

By henry35208 at Dec. 8, 2017, 8:51 a.m. (reply...)

Duplicate of 33890865

This is a duplicate of 33890865.


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!