mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
ios: fix resetting CallKit's CXProvider
When CallKit is enabled / disabled, a new CXProvider must be created in order to not confuse CallKit (it misbehaves otherwise).
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
eb38300c0d
commit
9a92dc578c
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user