1

我在下面的代码中初始化了我的 twilio 客户端,但出现错误

无法建立到 Twilio Sync 服务的连接

我的代码:

 public void build(String token,  TaskCompletionListener<ChatClient, String> listener) {
    ChatClient.Properties props =
            new ChatClient.Properties.Builder()
                    .setRegion("us1")
                    .createProperties();
    this.buildListener = listener;
    //Toast.makeText(context,"++-==++",Toast.LENGTH_LONG).show();
    ChatClient.create(context.getApplicationContext(),
            token,
            props,
            new CallbackListener<ChatClient>()
            {
                @Override
                public void onSuccess(ChatClient chatClient) {
                    Toast.makeText(context,chatClient.getMyIdentity(),Toast.LENGTH_LONG).show();
                }

                @Override
                public  void onError (ErrorInfo errorInfo)
                {
                   Log.e("++==00",errorInfo.getMessage());
                   Toast.makeText(context,errorInfo.getMessage(),Toast.LENGTH_LONG).show();
               }
            });
4

0 回答 0