Skip to main content

getAdvancedHistoryMessageList

Description

info

Get historical chat records in a conversation in chronological order (from new to old), such as loading historical messages when scrolling up.

Function Prototype


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

Input Parameters

Parameter NameParameter TypeRequiredDescription
OIMGetAdvancedHistoryMessageListParam.conversationIDNSStingYesConversation ID, if not empty, get by conversation ID, otherwise get by userID and groupID
OIMGetAdvancedHistoryMessageListParam.startClientMsgIDNSStringYesStarting message clientMsgID, empty string for first pull
OIMGetAdvancedHistoryMessageListParam.countNSIntegerYesAmount to pull at once
OIMGetAdvancedHistoryMessageListParam.lastMinSeqNSIntegerYeslastMinSeq is the value returned from the last pull callback, context used, needs to be passed back on the second pull

Return Result

NameTypeDescription
onSuccessNSArray< OIMGetAdvancedHistoryMessageListInfo * >Success 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) {

}];