mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix not display IncomingCall when pushnotification is disabled
This commit is contained in:
parent
1b3bc34fca
commit
21fbc51405
1 changed files with 14 additions and 2 deletions
|
|
@ -392,6 +392,15 @@ import AVFoundation
|
|||
class CoreManagerDelegate: CoreDelegate {
|
||||
static var speaker_already_enabled : Bool = false
|
||||
|
||||
func getProxyConfigByIncomingCall(call:Call, lc:Core) ->ProxyConfig? {
|
||||
let addr = call.toAddress
|
||||
let proxylist = lc.proxyConfigList
|
||||
if let index = proxylist.firstIndex(where: { $0.identityAddress?.asStringUriOnly() == addr?.asStringUriOnly() }) {
|
||||
return proxylist[index]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
override func onCallStateChanged(lc: Core, call: Call, cstate: Call.State, message: String) {
|
||||
let addr = call.remoteAddress;
|
||||
let address = FastAddressBook.displayName(for: addr?.getCobject) ?? "Unknow"
|
||||
|
|
@ -423,8 +432,11 @@ class CoreManagerDelegate: CoreDelegate {
|
|||
// The call is already answered.
|
||||
CallManager.instance().acceptCall(call: call, hasVideo: video)
|
||||
}
|
||||
} else if (!(CallManager.instance().alreadyRegisteredForNotification && UIApplication.shared.isRegisteredForRemoteNotifications)) {
|
||||
CallManager.instance().displayIncomingCall(call: call, handle: address, hasVideo: video, callId: callId!)
|
||||
} else {
|
||||
let cfg = getProxyConfigByIncomingCall(call: call, lc: lc)
|
||||
if (!((cfg?.isPushNotificationAllowed ?? true) && CallManager.instance().alreadyRegisteredForNotification && UIApplication.shared.isRegisteredForRemoteNotifications)) {
|
||||
CallManager.instance().displayIncomingCall(call: call, handle: address, hasVideo: video, callId: callId!)
|
||||
}
|
||||
}
|
||||
} else if (UIApplication.shared.applicationState != .active) {
|
||||
// not support callkit , use notif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue