Skip to main content

getAdvancedHistoryMessageListReverse

Feature Introduction

Description

Retrieve the historical chat records in a conversation in reverse order, suitable for pulling historical messages downwards when locating message context.

Function Prototype


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

Input Parameters

Parameter NameData TypeMandatoryDescription
OIMGetAdvancedHistoryMessageListParam.conversationIDNSStingYesConversation ID. If not empty, retrieve using conversation ID. Otherwise, retrieve using userID and groupID
OIMGetAdvancedHistoryMessageListParam.startClientMsgIDNSStringYesStart message clientMsgID, "" for the first fetch
OIMGetAdvancedHistoryMessageListParam.countNSIntegerYesNumber of messages to retrieve in one fetch
OIMGetAdvancedHistoryMessageListParam.lastMinSeqNSIntegerYeslastMinSeq is the value returned from the last fetch, needs to be provided for subsequent fetches

Return Result

NameTypeDescription
onSuccessNSArray< OIMGetAdvancedHistoryMessageListInfo * >Success return
onFailureOIMFailureCallbackFailure return

Code Example


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

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

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

}];