diff --git a/Session/Calls/Call Management/SessionCallManager.swift b/Session/Calls/Call Management/SessionCallManager.swift index 38ecd7b75..b33177ff7 100644 --- a/Session/Calls/Call Management/SessionCallManager.swift +++ b/Session/Calls/Call Management/SessionCallManager.swift @@ -136,6 +136,10 @@ public final class SessionCallManager: NSObject, CallManagerProtocol { func handleCallEnded() { WebRTCSession.current = nil UserDefaults.sharedLokiProject?.set(false, forKey: "isCallOngoing") + if CurrentAppContext().isInBackground() { + (UIApplication.shared.delegate as? AppDelegate)?.stopPollers() + DDLog.flushLog() + } } guard let call = currentCall else { diff --git a/Session/Meta/AppDelegate.swift b/Session/Meta/AppDelegate.swift index 01618a22e..d5f2b2b66 100644 --- a/Session/Meta/AppDelegate.swift +++ b/Session/Meta/AppDelegate.swift @@ -33,6 +33,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD Cryptography.seedRandom() AppVersion.sharedInstance() + AppEnvironment.shared.pushRegistrationManager.createVoipRegistryIfNecessary() // Prevent the device from sleeping during database view async registration // (e.g. long database upgrades). diff --git a/Session/Notifications/PushRegistrationManager.swift b/Session/Notifications/PushRegistrationManager.swift index c2df1a4f9..171ae9617 100644 --- a/Session/Notifications/PushRegistrationManager.swift +++ b/Session/Notifications/PushRegistrationManager.swift @@ -173,7 +173,7 @@ public enum PushRegistrationError: Error { } } - private func createVoipRegistryIfNecessary() { + public func createVoipRegistryIfNecessary() { AssertIsOnMainThread() guard voipRegistry == nil else { return }