I process push notification at
application(_:didReceiveRemoteNotification:fetchCompletionHandler:)
method in AppDelegate.swift
module
When application is active I show my own banner in application window:
if application.applicationState == .active {
// create banner
banner.show()
}
When application is in background iOS show system banner and my application receive info when application.applicationState
has .background
value. If user tapped the banner application receive data again but application.applicationState
is .inactive
- in this case I opens entity item that info was received in notification.
But when the device is locked with a password (ie requires code or fingerprint):
- Application receive notification data only when user did tap the banner, not immediately as in just background mode (when device is not password-locked)
- After unlock application state is still
.background
How can I differ background state after password-unlocking and background without locking?
I did try set flags by processing
applicationDidBecomeActive(_ application: UIApplication)
and
applicationWillEnterForeground(_ application: UIApplication)
events but
application(_:didReceiveRemoteNotification:fetchCompletionHandler:)
calls earlier