mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-14 03:40:00 +02:00
Merge pull request #5200 from vector-im/langleyd/5199_fix_failed_first_call_in_closed_app
Fix voip calls after singout/signin
This commit is contained in:
@@ -266,6 +266,15 @@ Matrix session observer used to detect new opened sessions.
|
||||
- (void)configurePushKit
|
||||
{
|
||||
MXLogDebug(@"[PushNotificationService] configurePushKit")
|
||||
NSData* token = [_pushRegistry pushTokenForType:PKPushTypeVoIP];
|
||||
if (token) {
|
||||
// If the token is available, store it. This can happen if you sign out and back in.
|
||||
// i.e We are registered, but we have cleared it from the the store on logout and the
|
||||
// _pushRegistry lives through signin/signout as PushNotificationService is a singleton
|
||||
// on app delegate.
|
||||
_pushNotificationStore.pushKitToken = token;
|
||||
MXLogDebug(@"[PushNotificationService] configurePushKit: Restored pushKit token")
|
||||
}
|
||||
|
||||
_pushRegistry.delegate = self;
|
||||
_pushRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP];
|
||||
|
||||
@@ -66,7 +66,7 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
}()
|
||||
private var pushNotificationStore: PushNotificationStore = PushNotificationStore()
|
||||
private let localAuthenticationService = LocalAuthenticationService(pinCodePreferences: .shared)
|
||||
|
||||
private static let backgroundServiceInitQueue = DispatchQueue(label: "io.element.NotificationService.backgroundServiceInitQueue")
|
||||
// MARK: - Method Overrides
|
||||
|
||||
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
|
||||
@@ -169,14 +169,16 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
MXKAccountManager.shared()?.forceReloadAccounts()
|
||||
self.userAccount = MXKAccountManager.shared()?.activeAccounts.first
|
||||
if let userAccount = userAccount {
|
||||
if NotificationService.backgroundSyncService?.credentials != userAccount.mxCredentials {
|
||||
MXLog.debug("[NotificationService] setup: MXBackgroundSyncService init: BEFORE")
|
||||
self.logMemory()
|
||||
NotificationService.backgroundSyncService = MXBackgroundSyncService(withCredentials: userAccount.mxCredentials)
|
||||
MXLog.debug("[NotificationService] setup: MXBackgroundSyncService init: AFTER")
|
||||
self.logMemory()
|
||||
Self.backgroundServiceInitQueue.sync {
|
||||
if NotificationService.backgroundSyncService?.credentials != userAccount.mxCredentials {
|
||||
MXLog.debug("[NotificationService] setup: MXBackgroundSyncService init: BEFORE")
|
||||
self.logMemory()
|
||||
NotificationService.backgroundSyncService = MXBackgroundSyncService(withCredentials: userAccount.mxCredentials)
|
||||
MXLog.debug("[NotificationService] setup: MXBackgroundSyncService init: AFTER")
|
||||
self.logMemory()
|
||||
}
|
||||
completion()
|
||||
}
|
||||
completion()
|
||||
} else {
|
||||
MXLog.debug("[NotificationService] setup: No active accounts")
|
||||
fallbackToBestAttemptContent(forEventId: eventId)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Fix bug where VoIP calls would not connect reliably after signout/signin.
|
||||
Reference in New Issue
Block a user