diff --git a/Config/CommonConfiguration.swift b/Config/CommonConfiguration.swift index 57fdb56a9..75202356d 100644 --- a/Config/CommonConfiguration.swift +++ b/Config/CommonConfiguration.swift @@ -63,8 +63,10 @@ class CommonConfiguration: NSObject, Configurable { // Disable identicon use sdkOptions.disableIdenticonUseForUserAvatar = true - // Use UIKit BackgroundTask for handling background tasks in the SDK - sdkOptions.backgroundModeHandler = MXUIKitBackgroundModeHandler() + DispatchQueue.main.async { + // Use UIKit BackgroundTask for handling background tasks in the SDK + sdkOptions.backgroundModeHandler = MXUIKitBackgroundModeHandler() + } // Pass httpAdditionalHeaders to the SDK sdkOptions.httpAdditionalHeaders = BuildSettings.httpAdditionalHeaders