Skip to main content

findMessageList

Function Introduction

Description

Search for local messages by message ID.

Note

Only supports messages that have been pulled to the local storage.

Function Prototype


- (void)findMessageList:(NSArray<OIMFindMessageListParam *> *)param
onSuccess:(nullable OIMMessageSearchCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

Parameter NameParameter TypeMandatoryDescription
OIMFindMessageListParam.conversationIDNSStingYesConversation ID. If not empty, retrieve by conversation ID, otherwise by userID and groupID
OIMFindMessageListParam.clientMsgIDListNSArray <NSString *>YesInitial message clientMsgID, pull for the first time as ""

Return Result

NameTypeDescription
onSuccessOIMSearchResultInfoSuccess return
onFailureOIMFailureCallbackFailure return

OIMSearchResultInfo

Field NameField TypeDescription
totalCountNSIntegerTotal number of messages retrieved
searchResultItemsNSArray< OIMSearchResultItemInfo * >Search results

Code Example


OIMFindMessageListParam *param = [OIMFindMessageListParam new];
param.conversationID = @"";
param.clientMsgIDList = @[];

[OIMManager.manager findMessageList:@[param]
onSuccess:^(OIMSearchResultInfo * _Nullable result) {

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

}];