【问题标题】:Sinch SDK callPhoneNumber get crash in the production appSinch SDK callPhoneNumber 在生产应用程序中崩溃
【发布时间】:2018-10-17 01:22:05
【问题描述】:

当我们使用production key & secrets 时,我们正在使用 sinch 拨打电话但收到错误:由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“客户端未启动”

我们在沙盒环境中成功测试,而不是因为生产应用程序凭据导致应用程序崩溃。

由于崩溃,Apple 拒绝了我们的应用

【问题讨论】:

    标签: ios iphone sinch


    【解决方案1】:

    如错误所述,这是因为客户端尚未成功启动。

    您要么在收到clientDidStart 之前尝试拨打电话,要么您正在收到clientDidFail:client error:error,在这种情况下出现问题,error 应该包含有关问题的更多信息。

    【讨论】:

    • 是的,它在 clientDidFail 中显示 SINErrorDomainApi 错误 4000
    • @SidShah:它还应该包含一条消息,可能类似于“InvalidSignature”
    • SINErrorDomainApi 错误 4000.)" UserInfo=0x787d3ff0 {serverCode=, serverMessage=ApplicationNotFound} 虽然 sinth 应用程序已在控制台中批准。
    【解决方案2】:

    @frals 的回答是对的。

    我只是用代码扩展它。

    class SinchCallViewController: UIViewController {
    var sinClient: SINClient!
    
    override func viewDidLoad() {
            super.viewDidLoad()
           sinClient = Sinch.client(withApplicationKey: "your key", applicationSecret: "Your secret key", environmentHost: "clientapi.sinch.com", userId: "your user id")
            sinClient.delegate = self
            sinClient.setSupportCalling(true)
            sinClient.start()
        }
    }
    
    extension SinchCallViewController: SINClientDelegate {
        func clientDidStart(_ client: SINClient!) {
            makeTheCall()
        }
    
        func clientDidFail(_ client: SINClient!, error: Error!) {
            print("error error-->\(error)")
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2014-05-07
      • 1970-01-01
      • 2022-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多