2016-02-26 41 views

回答

2

這是怎麼了,我終於做工作:

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: "[email protected]") 


    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("[email protected]") 
     call.delegate = self 

    } 

} 
+1

我已經使用'pod'SinchRTC''安裝了'Sinch',但不幸的是,當我嘗試'導入Sinch' *時,我沒有得到這樣的模塊'Sinch' *。 關於安裝的任何幫助 – Chlebta

+1

@Chlebta我沒有使用pod進行安裝,我只是手動添加了sinch框架,但是檢查了您的橋接頭,是否將它導入了那裏 –

+0

是的,你得到了我必須對bridging-Header 。H – Chlebta

相關問題