ios: fix background refresh (#769)

* ios: fix background refresh

* change app inactive check
This commit is contained in:
Evgeny Poberezkin
2022-07-02 08:50:25 +01:00
committed by GitHub
parent a8ba4ede82
commit 29c6d51e6a
5 changed files with 23 additions and 18 deletions

View File

@@ -61,17 +61,12 @@ class AppDelegate: NSObject, UIApplicationDelegate {
completionHandler(.noData)
}
} else if let checkMessages = ntfData["checkMessages"] as? Bool, checkMessages {
// TODO check if app in background
logger.debug("AppDelegate: didReceiveRemoteNotification: checkMessages")
// TODO remove
// NtfManager.shared.notifyCheckingMessages()
completionHandler(.noData)
// receiveMessages(completionHandler)
} else if let smpQueue = ntfData["checkMessage"] as? String {
// TODO check if app in background
logger.debug("AppDelegate: didReceiveRemoteNotification: checkMessage \(smpQueue)")
completionHandler(.noData)
// receiveMessages(completionHandler)
if isAppInactive() {
receiveMessages(completionHandler)
} else {
completionHandler(.noData)
}
} else {
completionHandler(.noData)
}