我使用Sinch sdk制作ios和android Calling Application并实现app-to-app调用功能。我已经成功开发了从ios到ios设备和android到android设备的调用应用程序。但是,当我从Android设备调用ios设备或从ios设备调用Android设备时,我可以听到呼叫连接和拨号音,但在其他平台端没有发生任何事情,呼叫没有到达那里。
当我查看日志时,我的状态为"没有答案" ,但在其他平台上没有收到任何电话。请让我知道这个问题的解决方案是什么。
代码详情:
if (mobile != nil) && self.client.isStarted() {
client.call().delegate = self
fullname = "\(dataArray[indexpathRow]["firstName"] as! String) \(dataArray[indexpathRow]["middleName"] as! String) \(dataArray[indexpathRow]["lastName"] as! String)"
let header: [String: String] = ["callerCallId": (logInDataModelObject?.user_id)!, "callerType": "1", "recieverCallId": "\(dataArray[indexpathRow]["id"] as! String)", "recieverType": "1", "CallerName": fullname!, "CallerPhoto": dataArray[indexpathRow]["photo"] as! String]
weak var call: SINCall? = client.call().callUser(withId: mobile, headers: header)
let controller1: CallViewController = CallViewController(nibName: "CallViewController", bundle: nil)
viewCallingAppear = true
controller1.title = "Call"
controller1.call = call
controller1.callingPersonName = fullname
controller1.userImage = dataArray[indexpathRow]["photo"] as? String
self.navigationController?.present(controller1, animated: true, completion: nil)
}
// MARK: - SINCallClientDelegate
func client(_ client: SINCallClient!, didReceiveIncomingCall call: SINCall!) {
if let rootViewController = UIApplication.topViewController() {
//do sth with root view controller
print(rootViewController)
let controller1: CallViewController = CallViewController(nibName: "CallViewController", bundle: nil)
controller1.call = call
let header = call.headers
controller1.callingPersonName = header!["CallerName"] as! String
controller1.userImage = header!["CallerPhoto"] as! String
rootViewController.present(controller1, animated: true, completion: nil)
}
}