如何在 swift 项目中使用 sinch 注册 VoIP

How to register with sinch for VoIP in swift project

我被困在一个地方,我需要在 swift 中声明以下行代码 -

如何声明id客户端;

我很难找到如何在 swift 中注册 sinch 的代码,所以大家帮帮我

这就是我最终实现它的方式:

class ViewController: UIViewController ,SINCallClientDelegate, SINCallDelegate , SINClientDelegate{


    @IBOutlet weak var callStatus: UILabel!

    let sinchClient : SINClient = Sinch.clientWithApplicationKey("093f31d0-858a-4947-b29e-38bd5b2300c5", applicationSecret: "iBS+k7WmnUOfKr5w1wureg==", environmentHost: "sandbox.sinch.com", userId: "John@transformative.in")


    var callClient : SINCallClient! ;
    var call : SINCall! ;
    var callClient : SINCallClient!;

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.


        sinchClient.setSupportCalling(true)
        sinchClient.start()
        sinchClient.startListeningOnActiveConnection()
        sinchClient.delegate = self
        callClient = sinchClient.callClient()

    }

    func clientDidStart(client: SINClient!) {
        print("Clien started")
    }

    func clientDidFail(client: SINClient!, error: NSError!) {

    }

    func clientDidStop(client: SINClient!) {

    }

    func client(client: SINClient!, logMessage message: String!, area: String!, severity: SINLogSeverity, timestamp: NSDate!) {

    }

    func callDidProgress(call: SINCall!) {

    }

    func callDidEstablish(call: SINCall!) {
        callStatus.text = "Call Connected"
    }

    func callDidEnd(call: SINCall!) {

    }

    func client(client: SINCallClient!, didReceiveIncomingCall call: SINCall!) {
        call.delegate = self;
        call.answer()

    }



    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func callMike(sender: AnyObject) {

        let call : SINCall = callClient.callUserWithId("NewMan@transformative.in")
        call.delegate = self

    }

}