• UIKit
  • SDK
  • 서버 API
Chat/
UIKit/
iOS and macOS/
Features/
UIKit
  • 개요
  • Run Demo
  • 시작
  • 설치
    • TUIKit
    • TUIChat만
  • Build Basic Interfaces
    • Chat
    • Conversation List
    • Contact List
    • Add Contact
    • Create Group Chat
    • Video and Audio Call
  • Features
    • 반응
    • Quote
    • 읽음 확인
    • 사용자 온라인 상태
    • Translation
    • Voice to Text
    • 메시지 검색
  • 맞춤화
    • 메시지 맞춤화
    • 이모티콘과 스티커 맞춤화
  • 현지화
  • Changelog
  • Guideline for Beginners
  • 콘솔 안내
    • 애플리케이션 생성 및 업그레이드
    • 기본 구성
    • 기능 구성
    • 계정 관리
    • 그룹 관리
    • 콜백 구성
  • 제품 소개
    • 메시지 관리
      • 1대1 메시지
      • 메시지 저장
      • 오프라인 푸시
      • 그룹 메시지
      • 메시지 포맷
    • 계정 시스템
      • 로그인 인증
      • 온라인 상태 관리
    • 그룹 관련
      • 그룹 시스템
      • 그룹 관리
    • 사용자 정보 및 관계망
      • 정보 관리
      • 관계망 관리
  • 구매 가이드
    • 과금 개요
    • 가격
  • 에러코드
이 페이지는 현재 영어로만 제공되며 한국어 버전은 곧 제공될 예정입니다. 기다려 주셔서 감사드립니다.

메시지 검색

Local search is implemented in the TUISearch component of TUIKit. It allows users to quickly find the expected information from massive amounts of complex data, such as the chat history, contacts, and group chats. It can also be used as an operations tool to easily and efficiently navigate to extensive content.
Note:
The local search feature is only available on the Chat Ultimate edition. To use it, purchase the Ultimate edition. For more information, see Pricing.

Feature Demonstration

The search API UI consists of three parts: the first part is for friend search, the second part is for group and group member search, and the third part is for message search, where messages are classified by conversation. Download and install the app to experience it now.

Integration Guide

The following introduces how to integrate the TUISearch component.

Purchasing the package

Integrating TUISearch

Add the following content to your Podfile:
// Integrate TUISearch
pod 'TUISearch'
Run pod instal.

Logging in to TUIKit

You need to call TUILogin of TUICore to log in to TUIKit. Initialization is implemented inside the login API by default, and no additional call to the initialization API is required.
[TUILogin login:SDKAPPID
userID:userID
userSig:userSig
succ:^{
// Login succeeded
} fail:^(int code, NSString *msg) {
// Login fails.
}];

Starting the search UI

If you have integrated the TUIConversation and TUISearch components, no additional processing is required at this point and searchBar is displayed above the conversation list by default.

If you have integrated only TUISearch, you can directly initialize TUISearchBar and add it to your own view. The search UI logic and UI are encapsulated inside TUISearchBar. After adding TUISearchBar, you can click it to trigger a search.
Sample code:
// Initialize the component
TUISearchBar *searchBar = [[TUISearchBar alloc] init];
// self.containerView indicates your own view
[self.containerView addSubview:searchBar];

FAQs

How do I search for custom messages?

You need to use the createCustomMessage:desc:extension API to create and send a custom message, and specify the text to search in the desc parameter.
If you use the createCustomMessage API to create a custom message, a binary data stream is saved locally, and the custom message cannot be searched.
If you configure the offline push feature and specify the desc parameter, the custom message will also be pushed offline, and the content specified in the desc parameter will be displayed in the notification bar. If you do not need the offline push feature, use the disablePush parameter in V2TIMOfflinePushInfo of the sendMessage API to disable it.
If you do not want the searched text to be displayed as the pushed content, use the desc parameter in V2TIMOfflinePushInfo to specify the pushed content.

How do I search for rich media messages?

Rich media messages include file, image, audio, and video messages.
For a file message, the filename is usually displayed on the UI. Therefore, you can set the fileName parameter as the searched content when creating a file message. If fileName is not set, the system gets the filename from filePath and saves it to both the local device and the server.
For an image, audio, or video message, the thumbnail or duration is usually displayed on the UI. In this case, you can specify the message type for search but cannot specify keywords for search.