注册

iOS 发送消息,出现服务器未知错误EMErrorServerUnknownError,但是在消息列表发送是没有问题的

EMTextMessageBody *body = [[EMTextMessageBody alloc] initWithText:[NSString stringWithFormat:@"你好,我是%@",[UserDataModel shareUser].nickName]];

    NSString *from = [[EMClient sharedClient] currentUsername];

    //生成Message

    EMMessage *message = [[EMMessage alloc] initWithConversationID:@"13800138029" from:from to:nil body:body ext:nil];

    message.chatType = EMConversationTypeChat;// 设置为单聊消息

    message.direction = EMMessageDirectionSend;

    [[EMClient sharedClient].chatManager asyncSendMessage:message progress:nil completion:^(EMMessage *aMessage, EMError *aError) {

        NSLog(@"%@",aError);




    }];
已邀请:
可以换个网络发消息试试,还有你发消息的时候 to为空了,要传接收消息方的环信id

要回复问题请先登录注册