Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

ios: fix resetting CallKit's CXProvider

Saúl Ibarra Corretgé9a92dc578c55
diff --git a/ios/sdk/src/callkit/JMCallKitProxy.swift b/ios/sdk/src/callkit/JMCallKitProxy.swift
index de7a0f4f19..b1e4b29538 100644
--- a/ios/sdk/src/callkit/JMCallKitProxy.swift
+++ b/ios/sdk/src/callkit/JMCallKitProxy.swift
@@ -27,7 +27,7 @@ import Foundation
// MARK: - CallKit proxy
- private static let provider: CXProvider = {
+ private static var provider: CXProvider = {
let configuration = CXProviderConfiguration(localizedName: "")
return CXProvider(configuration: configuration)
}()
@@ -52,9 +52,13 @@ import Foundation
/// Defaults to enabled, set to false when you don't want to use CallKit.
@objc public static var enabled: Bool = true {
didSet {
- if enabled == false {
+ provider.invalidate()
+ if enabled {
+ guard isProviderConfigured() else { return; }
+ provider = CXProvider(configuration: providerConfiguration!)
+ provider.setDelegate(emitter, queue: nil)
+ } else {
provider.setDelegate(nil, queue: nil)
- provider.invalidate()
}
}
}