Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sinch iOS应用程序:识别应用程序是否接收视频或语音呼叫_Ios_Swift_Sinch - Fatal编程技术网

Sinch iOS应用程序:识别应用程序是否接收视频或语音呼叫

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

我在sinch的swift项目中集成了视频通话和语音通话。但问题是,在
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)
        }

  }