searchLocalMessages

Introduction

Search message form local app

Parameter details

Parameter name Parameter type Required Description
searchParam V2TimMessageSearchParam yes The search parameter.

Returned template

V2TimValueCallback<V2TimMessageSearchResult>

{
    code : number
    desc : string
    data : {
      messageSearchResultItems : V2TimMessageSearchResultItem[]// The list of search result messages.
      totalCount : number // The amount of results.
    }
}

Return value details

name type description
code number Request result: Error codes. 0 means success.
desc string The description of the error. It will be empty if success.
data V2TimMessageSearchResult The list of search result messages.

Code example

import { TencentImSDKPlugin } from 'react-native-tim-js';

const searchLocalMessagesRes = await TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .searchLocalMessages({
        conversationID: '',
        keywordList: [],
        type: 0,
        userIDList: [],
        messageTypeList: [],
        searchTimePeriod: 0,
        searchTimePosition: 0,
        pageIndex: 0,
        pageSize: 10,
    });
if (searchLocalMessagesRes.code === 0) {

}

results matching ""

    No results matching ""