调用文档提供方法发送失败,且查询不到历史记录 ,有些可以查到,只能查到发出的,没有收到的信息
AVIMConversationQuery *query = [self.client conversationQuery];
[query whereKeyExists:@"m"];
// 执行查询
[query findConversationsWithCallback:^(NSArray *objects, NSError *error) {
if (objects&&objects.count>0) {
AVIMConversation *conversation = objects.firstObject;
AVIMTextMessage *msg = [AVIMTextMessage messageWithText:@"hello world!" attributes:nil];
[conversation sendMessage:msg callback:^(BOOL succeeded, NSError * _Nullable error) {
if (!error) {
NSLog(@"发送成功!");
}else{
NSLog(@"发送失败!%@",error);
}
}];
}
------ BEGIN LeanCloud IM In Command ------
content: : {
cmd: ack
peerId: "5eb8d6df086e1f00088c15e7"
i: 5
service: 2
ackMessage {
code: 4401
reason: "INVALID_MESSAGING_TARGET"
t: 1590478891849
uid: "vQOlU4kDQ4GrNe_zWedzrQ"
}
}
------ END --------------------------------
2020-05-26 15:41:31.863331+0800 Chat[61713:3936231] 发送失败:Error Domain=com.LeanCloud.ErrorDomain Code=4401 "INVALID_MESSAGING_TARGET" UserInfo={NSLocalizedFailureReason=INVALID_MESSAGING_TARGET}