Skip to main content

getAdvancedHistoryMessageList

Feature Introduction

Note

Retrieve the historical chat records from the latest message in a conversation.

Function Prototype


- (void)getAdvancedHistoryMessageList:(OIMGetAdvancedHistoryMessageListParam *)opts
onSuccess:(nullable OIMGetAdvancedHistoryMessageListCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

Parameter NameParameter TypeMandatoryDescription
OIMGetAdvancedHistoryMessageListParam.conversationIDNSStringYesConversation ID. If not empty, retrieve by conversation ID, otherwise through userID and groupID
OIMGetAdvancedHistoryMessageListParam.startClientMsgIDNSStringYesStarting message clientMsgID, first fetch is ""
OIMGetAdvancedHistoryMessageListParam.countNSIntegerYesNumber of messages to fetch
OIMGetAdvancedHistoryMessageListParam.lastMinSeqNSIntegerYeslastMinSeq is the value returned from the previous fetch, context required for the second fetch onward

Return Result

NameTypeDescription
onSuccessNSArray< OIMGetAdvancedHistoryMessageListInfo * >Successful return
onFailureOIMFailureCallbackFailure return

Code Example


OIMGetAdvancedHistoryMessageListParam *opts = [OIMGetAdvancedHistoryMessageListParam new];
opts.conversationID = @"";
opts.count = 30;
opts.lastMinSeq = @"";

[OIMManager.manager getAdvancedHistoryMessageList:opts
onSuccess:^(OIMGetAdvancedHistoryMessageListInfo * _Nullable result) {

} onFailure:^(NSInteger code, NSString * _Nullable msg) {

}];