你们这个逻辑能真正做到消息不丢失吗,如果两部终端1,2同时登录账号A,两部手机都在线收到消息没问题,但是如果一个手机1退到后台,另一个手机2在前台,都给这个A发送消息,后台手机1收不到推送 ,处于正常现象,因为2除于在线状态,1从后台到前台,收不到离线消息也属于正常现象,但是1点击会话详情,通过你们的消息策略,能不能把离线消息拉取下来,目前测试是丢消息的,这个场景就是多终端登录同一账号,保证消息的一致性。

  • (void)queryMessagesFromServerBeforeId:(NSString *)messageId
    timestamp:(int64_t)timestamp
    toMessageId:(NSString *)toMessageId
    toTimestamp:(int64_t)toTimestamp
    limit:(NSUInteger)limit
    callback:(AVIMArrayResultBlock)callback
    {
    AVIMGenericCommand *genericCommand = [[AVIMGenericCommand alloc] init];
    AVIMLogsCommand *logsCommand = [[AVIMLogsCommand alloc] init];
    genericCommand.needResponse = YES;
    genericCommand.cmd = AVIMCommandType_Logs;
    genericCommand.peerId = _imClient.clientId;
    logsCommand.cid = _conversationId;
    logsCommand.mid = messageId;
    logsCommand.tmid = toMessageId;
    logsCommand.tt = MAX(toTimestamp, 0);
    logsCommand.t = MAX(timestamp, 0);
    // logsCommand.l = LCIM_VALID_LIMIT(limit);
    [genericCommand avim_addRequiredKeyWithCommand:logsCommand];
    [self queryMessagesFromServerWithCommand:genericCommand callback:callback];
    }

我有个建议,既然设置了开始消息以及结束消息id 这边为什么还要传limit呢,传了不会丢消息吗