我正在使用Callkit和Linphone开发iOS voip应用程序.当我收到来电时,系统显示本机电话用户界面,用户接受或拒绝接听电话,当用户点按接听按钮时,呼叫开始但电话用户界面消失.
如何在用户接听电话后保留本机手机用户界面,例如whatsapp吗?
这是我的providerDelegate代码:
func reportIncomingCall(uuid: UUID,handle: String,hasVideo: Bool = false,completion: ((NSError?) -> Void)? = nil) { // Construct a CXCallUpdate describing the incoming call,including the caller. let update = CXCallUpdate() update.remoteHandle = CXHandle(type: .generic,value: handle) update.hasVideo = hasVideo // Report the incoming call to the system provider.reportNewIncomingCall(with: uuid,update: update) { error in /* Only add incoming call to the app's list of calls if the call was allowed (i.e. there was no error) since calls may be "denied" for varIoUs legitimate reasons. See CXErrorCodeIncomingCallError. */ if error == nil { print("calling") } } } func provider(_ provider: CXProvider,perform action: CXStartCallAction) { let update = CXCallUpdate() update.remoteHandle = action.handle provider.reportOutgoingCall(with: action.uuid,startedConnectingAt: Date()) NotificationCenter.default.post(name: NSNotification.Name(rawValue: "callStart"),object: self,userInfo: ["uuid":action.uuid]) action.fulfill(withDateStarted: Date()) } func provider(_ provider: CXProvider,perform action: CXAnswerCallAction) { NotificationCenter.default.post(name: NSNotification.Name(rawValue: "callStart"),userInfo: ["uuid":action.uuid]) // ACCEPT CALL ON SIP MANAGER if let voiceCallManager = AppDelegate.voiceCallManager { voiceCallManager.acceptCall() } action.fulfill(withDateConnected: Date()) }
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。