Sinch iOS应用程序:识别应用程序是否接收视频或语音呼叫
我在sinch的swift项目中集成了视频通话和语音通话。但问题是,在Sinch iOS应用程序:识别应用程序是否接收视频或语音呼叫,ios,swift,sinch,Ios,Swift,Sinch,我在sinch的swift项目中集成了视频通话和语音通话。但问题是,在appDelegate中,我有一个函数didReceiveInMingCall。如何在此函数中输入一些代码,以确定调用是语音调用以显示voiceCallVC还是视频调用以显示VideoVC func client(_ client: SINCallClient!, didReceiveIncomingCall call: SINCall!) { var top = self.window?.rootVi
appDelegate
中,我有一个函数didReceiveInMingCall
。如何在此函数中输入一些代码,以确定调用是语音调用以显示voiceCallVC
还是视频调用以显示VideoVC
func client(_ client: SINCallClient!, didReceiveIncomingCall call: SINCall!) {
var top = self.window?.rootViewController
while (top?.presentedViewController != nil) {
top = top?.presentedViewController
}
let videoVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "videoVC") as! VideoCallVC
videoVC._call = call
top?.present(videoVC, animated: true, completion: nil)
let callVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "CallVC") as! VoiceCallVC
callVC._call = call
top?.present(callVC, animated: true, completion: nil)
}
您可以检查Bool值
“call.details.isvideoprovided”
这是代码
func client(_ client: SINCallClient!, didReceiveIncomingCall call: SINCall!) {
var top = self.window?.rootViewController
while (top?.presentedViewController != nil) {
top = top?.presentedViewController
}
if (call.details.isVideoOffered)
{
let videoVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "videoVC") as! VideoCallVC
videoVC._call = call
top?.present(videoVC, animated: true, completion: nil)
}
else{
let callVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "CallVC") as! VoiceCallVC
callVC._call = call
top?.present(callVC, animated: true, completion: nil)
}
}