add logs and fix a case when the call is going with CallKit but the app state is not in background

pull/1053/head
Ryan ZHAO 5 months ago
parent 58707da75e
commit 1dddedf3eb

@ -7778,7 +7778,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 502;
CURRENT_PROJECT_VERSION = 503;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -7849,7 +7849,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 502;
CURRENT_PROJECT_VERSION = 503;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",

@ -199,6 +199,7 @@ public final class SessionCallManager: NSObject, CallManagerProtocol {
}
public static func suspendDatabaseIfCallEndedInBackground() {
SNLog("[Calls] suspendDatabaseIfCallEndedInBackground.")
if Singleton.hasAppContext && Singleton.appContext.isInBackground {
// FIXME: Initialise the `SessionCallManager` with a dependencies instance
let dependencies: Dependencies = Dependencies()

@ -354,7 +354,7 @@ final class HomeVC: BaseVC, LibSessionRespondingViewController, UITableViewDataS
// Start polling if needed (i.e. if the user just created or restored their Session ID)
if Identity.userExists(), let appDelegate: AppDelegate = UIApplication.shared.delegate as? AppDelegate, Singleton.appContext.isInBackground == false {
SNLog("[HomeVC]: Starting pollers... \(Singleton.appContext.reportedApplicationState)")
SNLog("[HomeVC]: Starting pollers...")
appDelegate.startPollersIfNeeded()
}

@ -46,7 +46,9 @@ public extension AppContext {
var frontmostViewController: UIViewController? { nil }
var backgroundTimeRemaining: TimeInterval { 0 }
var isInBackground: Bool { reportedApplicationState == .background }
// Note: .inactive is a strange state, if the app is activated by VOIP and CallKit is up in the front,
// the app will report .inactive state
var isInBackground: Bool { reportedApplicationState == .background || reportedApplicationState == .inactive }
var isAppForegroundAndActive: Bool { reportedApplicationState == .active }
// MARK: - Paths

Loading…
Cancel
Save