注册

怎么样根据username 用户注册的账号读取和她聊天的最后一跳信息 和时间

怎么样根据username 用户注册的账号读取和她聊天的最后一跳信息 和时间
已邀请:
你可以根据对方的环信ID去获取到会话(前提是之前收发过,存在这条会话),然后可以通过会话的latestMessage属性来获取到会话中的最新一条消息。时间的话,可以通过前面获取到的消息(EMMessage)中的timestamp属性获取到。
 
    EMConversation *conversation = [[EaseMob sharedInstance].chatManager conversationForChatter:@"username" conversationType:eConversationTypeChat];

    

    EMMessage *message = conversation.latestMessageFromOthers;

    long timestamps = message.timestamp;

要回复问题请先登录注册