When I open navigation drawer application.ApplicationState should be Inactive but in iOS 11 it is Active.
I want to detect if application: didReceiveRemoteNotification was called by tapping on a notification in Notification Center
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
let state : UIApplicationState = application.applicationState
if (state == .Inactive || state == .Background) {
// go to screen relevant to Notification content
} else {
// App is in UIApplicationStateActive (running in foreground)
}
}
Is it a bug in iOS 11 or is there new approach with Push Notifications?
Other way to check applicationState:
func applicationWillResignActive(_ application: UIApplication) {
var app = application.applicationState
}