Starter Deal! First 3 month from only  $9.9 /month!
Starter Deal! First 3 month from only  $9.9 /month!
Grab It Now 
Chat
  • Web
    • TUIKit
      • Overview
      • Installaton
        • TUIKit
          • Vue
          • React
        • TUIChat Only
          • Vue
      • Features
        • Reactions
        • Read Receipt
        • Typing Status
        • User Online Status
      • Themes
        • Setting UI Styles
          • Web
          • Mobile
      • Customization
        • Customize Messages
      • Localization
    • SDK
      • Install Chat SDK
      • Initialize Chat SDK
      • Login and Logout
      • Client APIs
      • Message
        • Overview
        • Send a Message
        • Receive a Message
        • Historical Message
        • Forward Messages
        • Modify a Message
        • Delete Messages
        • Clear History Message
        • Recall a Message
        • Send an Online Message
        • Message Read Receipt
        • Query Messages
        • Targeted Group Message
        • Do not Notify
        • Key-Value Extensions
        • Translation
      • Conversation
        • Overview
        • Conversation List
        • Get Conversations
        • Unread Count
        • Pin Conversations
        • Delete Conversations
        • Mark
        • Conversation Group
      • Group
        • Overview
        • Group Management
        • Group Profile
        • Group Member Management
        • Group Member Profile
        • Custom Group Attribute
        • Group Counter
      • Community Topic
        • Community Management
      • User Profile and Relationship Chain
        • User Profile
        • User Status
        • Friend Management
        • Friend List
        • Block List
  • Android
    • Run Demo
    • UIKit
      • Overview
      • Getting Started
      • Installation
        • TUIKit
        • TUIChat Only
      • Features
        • Reactions
        • Read Receipt
        • User Online Status
        • Search Messages
      • Customization
        • Customize Messages
        • Customize Emojis and Stickers
      • Localization
    • SDK
      • Install Chat SDK
      • Initialize Chat SDK
      • Login and Logout
      • Message
        • Overview
        • Send a Message
        • Receive a Message
        • Retrieve Messages
        • Forward Messages
        • Modify a Message
        • Insert a Message
        • Delete Messages
        • Clear History Messages
        • Recall a Message
        • Send an Online Message
        • Message Read Receipt
        • Query Messages
        • Metions
        • Targeted Group Message
        • Do not Notify
        • Key-Value Extensions
        • Reactions
        • Translation
        • Pin Messages
      • Conversation
        • Overview
        • Conversation List
        • Get Conversations
        • Unread Count
        • Pin Conversations
        • Delete Conversations
        • Draft
        • Mark
        • Conversation Group
      • Group
        • Overview
        • Manage Group
        • Profile
        • Manage Members
        • Member Profile
        • Attribute
        • Counter
      • Community and Topic
        • Manage Community
        • Permission Group
      • User
        • User Profile
        • User Status
        • Manage Friends
        • Friend Group
        • Block Lists
      • Local Search
        • Search Messages
        • Search Friends
        • Search Groups
        • Search Group Members
      • Signaling
      • API Reference
        • Java
  • iOS and macOS
    • Run Demo
    • UIKit
      • Overview
      • Getting Started
      • Installation
        • TUIKit
        • TUIChat Only
      • Features
        • Reactions
        • Read Receipt
        • User Online Status
        • Search Messages
      • Customization
        • Customize Messages
        • Customize Emojis and Stickers
      • Localization
    • SDK
      • Installation
        • iOS
        • macOS
      • Initialize Chat SDK
      • Login and Logout
      • Message
        • Overview
        • Send a Message
        • Receive a Message
        • Retrieve Messages
        • Forward Messages
        • Modify a Message
        • Insert a Message
        • Delete Messages
        • Clear History Messages
        • Recall a Message
        • Send an Online Message
        • Message Read Receipt
        • Query Messages
        • Metions
        • Targeted Group Messages
        • Do not Notify
        • Key-Value Extensions
        • Reactions
        • Translation
        • Pin Messages
      • Conversation
        • Overview
        • Conversation List
        • Get Conversations
        • Unread Count
        • Pin Conversations
        • Delete Conversations
        • Draft
        • Mark
        • Conversation Group
      • Group
        • Overview
        • Manage Group
        • Profile
        • Manage Members
        • Member Profile
        • Attribute
        • Counter
      • Community and Topic
        • Manage Community
        • Permission Group
      • User
        • User Profile
        • User Status
        • Manage Friends
        • Friend Group
        • Block Lists
      • Local Search
        • Search Messages
        • Search Friends
        • Search Groups
        • Search Group Members
      • Signaling
      • API Reference
        • Swift
        • Objective-C
  • Windows
    • SDK
      • Install Chat SDK
      • Initialize Chat SDK
      • Login and Logout
      • Message
        • Overview
        • Send a Message
        • Receive a Message
        • Retrieve Messages
        • Forward Messages
        • Modify a Message
        • Insert a Message
        • Delete Messages
        • Clear History Messages
        • Recall a Message
        • Send an Online Message
        • Message Read Receipt
        • Query Messages
        • Metions
        • Targeted Group Messages
        • Do not Notify
        • Key-Value Extensions
        • Reactions
        • Translation
        • Pin Messages
      • Conversation
        • Overview
        • Conversation List
        • Get Conversations
        • Unread Count
        • Pin Conversations
        • Delete Conversations
        • Draft
        • Mark
        • Conversation Group
      • Group
        • Overview
        • Manage Group
        • Profile
        • Manage Members
        • Member Profile
        • Attribute
        • Counter
      • Community and Topic
        • Manage Community
        • Permission Group
      • User
        • User Profile
        • User Status
        • Manage Friends
        • Friend Group
        • Block Lists
      • Local Search
        • Search Messages
        • Search Friends
        • Search Groups
        • Search Group Members
      • Signaling
      • API Reference
        • C++
        • C
  • Flutter
    • Run Demo
    • UIKIT
      • Overview
      • Installation
        • integrated
      • Features
        • Local Search
        • Offline Push
        • Online Status
        • Typing Status
        • Message Read Receipt
        • Message Reactions
        • Internationalization
        • Adding Custom Messages
        • Emoji & Stickers
      • Customization
        • Modifying UI Themes
        • Setting UI Styles
    • SDK
      • Install Chat SDK
        • Install
      • Initialize Chat SDK
        • Initialize
      • Login And Logout
        • Login and Logout
      • Message
        • Message Overview
        • Sending Message
        • Receiving Message
        • Historical Message
        • Forwarding Message
        • Modifying Message
        • Message Inserting
        • Deleting Message
        • Clearing Messages
        • Recalling Message
        • Online Message
        • Read Receipt
        • Querying Message
        • Group @ Message
        • Targeted Group Message
        • Notification Muting
        • Message Extension
      • Conversation
        • Conversation Overview
        • Conversation List
        • Getting Conversation
        • Conversation Unread Count
        • Pinning Conversation to the Top
        • Deleting Conversation
        • Conversation Draft
        • Conversation Group
      • Group
        • Group Overview
        • Group Management
        • Group Profile
        • Group Member Management
        • Group Member Profile
        • Custom Group Attribute
      • User
        • User Profile
        • Friend Management
        • Friend List
        • Blocklist
      • Offline Push
        • Offline Push
      • Signaling
        • Signaling Management
      • Local Search
        • Searching for Message
        • Searching for Friend
        • Searching Group
        • Searching for Group Member
      • API Reference
        • Client APIs
  • React Native
    • Run Demo
    • SDK
      • SDK Integration
      • Initialization
      • Login and Logout
      • Message
        • Message Overview
        • Sending Message
        • Receiving Message
        • Historical Message
        • Forwarding Message
        • Modifying Message
        • Message Inserting
        • Deleting Message
        • Clearing Messages
        • Recalling Message
        • Online Message
        • Read Receipt
        • Querying Message
        • Group @ Message
        • Targeted Group Message
        • Notification Muting
        • Message Extension
      • Group
        • Overview
        • Group Management
        • Group Profile
        • Group Member Management
        • Group Member Profile
        • Custom Group Attribute
        • Community Management
      • User
        • User Profile
        • Friend Management
        • Friend List
        • Blocklist
      • Offline Push
        • Offline Push
      • Local Search
        • Searching for Message
        • Searching for Friend
        • Searching Group
        • Searching for Group Member
      • Signaling
        • Signaling Management
  • Unity(Game Solution)
    • Run Demo
    • SDK
      • SDK Integration
      • Initialization
      • Login and Logout
      • Message
        • Message Overview
        • Sending Message
        • Receiving Message
        • Historical Message
        • Forwarding Message
        • Modifying Message
        • Deleting Message
        • Clearing Messages
        • Recalling Message
        • Online Message
        • Read Receipt
        • Querying Message
        • Group @ Message
        • Targeted Group Message
        • Notification Muting
        • Message Extension
      • Conversation
        • Conversation Overview
        • Conversation List
        • Getting Conversation
        • Conversation Unread Count
        • Pinning Conversation to the Top
        • Deleting Conversation
        • Conversation Draft
        • Conversation Mark
        • Conversation Group
      • Group
        • Group Overview
        • Group Management
        • Group Profile
        • Group Member Management
        • Group Member Profile
        • Custom Group Attribute
        • Group Counter
      • User
        • User Profile
        • User Status
        • Friend Management
        • Friend List
        • Blocklist
  • Unreal Engine(Game Solution)
    • SDK
      • SDK Integration
  • Free Demos
  • Server APIs
    • Generating UserSig
    • RESTful APIs
      • RESTful API Overview
      • RESTful API List
      • Message Related
        • Send Message
          • Sending One-to-One Messages to One User
          • Sending One-to-One Messages to Multiple Users
          • Sending Ordinary Messages in a Group
          • Sending System Messages in a Group
          • Broadcast Message of Audio-Video Group
          • Importing One-to-One Messages
          • Importing Group Messages
        • Historical Message
          • Modifying Historical One-to-one Messages
          • Modifying Historical Group Messages
          • Pulling Historical One-to-one Messages
          • Pulling Historical Group Messages
        • Delete Message
          • Deleting Messages Sent by a Specified User
        • Withdraw Message
          • Recalling One-to-One Messages
          • Recalling Group Messages
        • Read Receipt
          • Marking One-to-One Messages as Read
          • Pulling Group Message Read Receipt Details
          • Pulling Read Receipts for Group Messages
        • Message Extension
          • Pulling the Message Extension of a One-to-One Message
          • Configuring Message Extension for a One-to-One Message
          • Pulling Message Extension of a Group Message
          • Configuring Message Extension for a Group Message
        • Pushing to All Users
          • API for Pushing to All Users
          • Pushing to All Users
          • Setting Application Attribute Names
          • Getting Application Attribute Names
          • Getting User Attributes
          • Setting User Attributes
          • Deleting User Attributes
          • Getting User Tags
          • Adding User Tags
          • Deleting User Tags
          • Deleting All Tags of a User
      • Session Related
        • Conversation List
          • Pulling a conversation list
        • Session Unread Count
          • Setting the Unread Message Count of a Member
          • Querying Unread One-to-One Message Count
        • Delete Session
          • Deleting a conversation
        • Session Grouping Tag
          • Creating Conversation Group Data
          • Updating Conversation Group Data
          • Deleting Conversation Group Data
          • Creating or Updating Conversation Mark Data
          • Searching for Conversation Group Marks
          • Pulling Conversation Group Mark Data
      • Group Related
        • Group Management
          • Getting All Groups in an App
          • Creating a Group
          • Disbanding a Group
          • Getting the Groups a User Has Joined
        • Group Information
          • Getting Group Profiles
          • Modifying the Profile of a Group
          • Importing a Group Profile
        • Group Member Management
          • Adding Group Members
          • Deleting Group Members
          • Banning Group Members
          • Unbanning Group Members
          • Bulk Muting and Unmuting
          • Getting the List of Muted Group Members
          • Changing Group Owner
          • Querying the Roles of Users in a Group
          • Importing Group Members
        • Group Member Information
          • Getting Group Member Profiles
          • Modifying the Profile of a Group Member
        • Group Custom Attributes
          • Getting Group Custom Attributes
          • Modifying Group Custom Attributes
          • Clearing Group Custom Attributes
          • Resetting Group Custom Attributes
          • Deleting Group Custom Attributes
        • Live Group Management
          • Getting the Number of Online Users in an Audio-Video Group
          • Getting the List of Online Members in Audio-Video Group
          • Setting Audio-Video Group Member Marks
          • Getting the List of Banned Group Members.
        • Community Management
          • Creating Topic
          • Deleting Topic
          • Getting Topic Profile
          • Modifying Topic Profile
          • Importing Topic Profiles
        • Group Counter
          • Getting Group Counters
          • Updating Group Counters
          • Deleting Group Counters
      • User Management
        • Account Management
          • Importing a Single Account
          • Importing Multiple Accounts
          • Deleting Accounts
          • Querying Accounts
        • User Information
          • Setting Profiles
          • Pulling Profiles
        • User Status
          • Invalidating Account Login States
          • Querying Account Online Status
        • Friend Management
          • Adding Friends
          • Importing Friends
          • Updating Friends
          • Deleting Friends
          • Deleting All Friends
          • Verifying Friends
          • Pulling Friends
          • Pulling Specified Friends
        • Friend Lists
          • Adding Lists
          • Deleting Lists
          • Pulling Lists
        • Blocklist
          • Blocklisting Users
          • Unblocklisting Users
          • Pulling a Blacklist
          • Verifying Users on a Blocklist
      • Global Mute Management
        • Setting Global Mute
        • Querying Global Mute
      • Operations Management
        • Pulling Operations Data
        • Downloading Recent Messages
        • Getting Server IP Addresses
      • Chatbots
        • Pulling Chatbot Accounts
        • Creating Chatbot Accounts
        • Deleting Chatbot Accounts
    • Webhooks
      • Webhook Overview
      • Webhook Command List
      • Operations Management Callbacks
        • API Overclocking Alarm Callbacks
      • Online Status Webhooks
        • Status Change Webhooks
      • Relationship Chain Webhooks
        • After a Profile Is Updated
        • Before a Friend Is Added
        • Before a Friend Request Is Responded
        • After a Friend Is Added
        • After a Friend Is Deleted
        • After a User Is Added to Blocklist
        • After a User Is Removed from Blocklist
      • One-to-One Message Webhooks
        • Before a One-to-One Message Is Sent
        • After a One-to-One Message Is Sent
        • After a One-to-One message Is Marked as Read
        • After A One-to-One Message Is Recalled
      • Group Webhooks
        • Before a Group Is Created
        • After a Group Is Created
        • Before Applying to Join a Group
        • Before Inviting a User to a Group
        • After a User Joins a Group
        • After a User Leaves a Group
        • Before Group Message Is Sent
        • After a Group Message Is Sent
        • After a Group Is Full
        • After a Group Is Disbanded
        • After Group Profile Is Modified
        • Callback After Recalling Group Messages
        • Webhook for Online and Offline Status of Audio-Video Group Members
        • Webhook for Exceptions When Group Messages Are Sent
        • Before a Topic Is Created
        • After a Topic Is Created
        • After a Topic Is Deleted
        • Topic Profile Change Webhook
        • Callback After Group Member Profile Changed
        • Callback After Group Attribute Changed
        • Callback After Read Receipt
        • Callback After the Group Owner Changed
      • Webhook Mutual Authentication Configuration Guide
        • Apache Mutual Authentication Configuration
        • Nginx Mutual Authentication Configuration
      • Chatbot webhooks
        • Chatbot Passthrough Message Callback
  • Console Guide
    • Creating and Upgrading an Application
    • Basic Configuration
    • Feature Configuration
    • Account Management
    • Group Management
    • Webhook Configuration
  • Product Introduction
    • Message Management
      • One-to-One Message
      • Message Storage
      • Offline Push
      • Group Message
      • Message Formats
    • Account System
      • Login Authentication
      • Online Status Management
    • Group Related
      • Group System
      • Group Management
    • User Profile and Relationship Chain
      • Profile Management
      • Relationship Chain Management
  • Purchase Guide
    • Billing Overview
    • Pricing
  • Error Codes
Chat

TUIKit

TUIKit supports modular integration starting from version 5.7.1435. You can integrate modules for integration according to your needs. Starting from version 6.9.3557, TUIKit provides a new set of minimalist version UI components. The previous version UI components are still retained, which are called the classic version UI components. You can choose either the classic or minimalist version as needed.
For more information about TUIKit components, see here.
The following describes how to integrate TUIKit components.

Environment Requirements

Xcode 10 or later
iOS 9.0 or later

Quickly Running the Demo

When you use TUIKit for the first time, we strongly recommend you to download and run the TUIKitDemo source code, to experience all the features of TUIKit by using our TUIKitDemo. Moreover, most environment-related issues have been addressed in our example project, so come and experience it.

CocoaPods Integration

1. Install CocoaPods Enter the following command in a terminal (you need to install Ruby on your Mac first):
sudo gem install cocoapods
2. Add the corresponding TUIKit components to your Podfile according to business needs. TUIKit components are independent of each other, adding or removing them does not affect project compilation.
Two Podfile integration methods are available, including Pods integration (Method 1) and DevelopPods local integration (Method 2).
Note:
Pods integration (Method 1) is suitable when source codes are not changed:
Advantage: In case of TUIKit version updating, you only need to run Pod update again to complete the update.
Disadvantage: When source codes are changed, running Pod update will overwrite your modifications with the new version of TUIKit.
DevelopPods local integration (Method 2) is suitable for customers with custom modifications of source codes:
Advantage: When you have git repositories, you can track modifications. After source codes are changed, using Pod update (other non-local integration Pods) will not overwrite your modifications.
Disadvantage: You need to manually overwrite your local TUIKit folder based on the TUIKit source code for updates.

Method 1: Remote CocoaPods Integration

Note:
This method is recommended if source code modification is needed.
The following is a Podfile configuration example:
Minimalist version
Classic version
# Uncomment the next line to define a global platform for your project
# ...
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '13.0'
# Prevent `*.xcassets` in TUIKit from conflicting with your project
install! 'cocoapods', :disable_input_output_paths => true

# Replace `your_project_name` with your actual project name
target 'your_project_name' do
# Comment the next line if you don't want to use dynamic frameworks
# TUIKit components are dependent on static libraries. Therefore, you need to mask the configuration.
# use_frameworks!

# Enable modular headers as needed. Only after you enable modular headers, the Pod module can be imported using @import.
# use_modular_headers!

# Integrate the chat feature
pod 'TUIChat/UI_Minimalist'
# Integrate the conversation list feature
pod 'TUIConversation/UI_Minimalist'
# Integrate the relationship chain feature
pod 'TUIContact/UI_Minimalist'
# Integrate the group feature
pod 'TUIGroup/UI_Minimalist'
# Integrate the search feature (To use this feature, you need to purchase the Premium edition)
pod 'TUISearch/UI_Minimalist'
# Integrate the offline push feature
pod 'TIMPush'
# Integrate the audio/video call feature
pod 'TUICallKit'

end

#Pods config
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
#Fix Xcode14 Bundle target error
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
config.build_settings['ENABLE_BITCODE'] = "NO"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
#Fix Xcode15 other links flag -ld64
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
if xcode_version >= 15
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
if xcconfig.include?("OTHER_LDFLAGS") == false
xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
else
if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
end
if xcconfig.include?("-ld64") == false
xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
end
end
File.open(xcconfig_path, "w") { |file| file << xcconfig }
end
end
end
end
# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '13.0'
# Prevent `*.xcassets` in TUIKit from conflicting with your project
install! 'cocoapods', :disable_input_output_paths => true

# Replace `your_project_name` with your actual project name
target 'your_project_name' do
# Comment the next line if you don't want to use dynamic frameworks
# TUIKit components are dependent on static libraries. Therefore, you need to mask the configuration.
# use_frameworks!

# Enable modular headers as needed. Only after you enable modular headers, the Pod module can be imported using @import.
# use_modular_headers!

# Integrate the chat feature
pod 'TUIChat/UI_Classic'
# Integrate the conversation list feature
pod 'TUIConversation/UI_Classic'
# Integrate the relationship chain feature
pod 'TUIContact/UI_Classic'
# Integrate the group feature
pod 'TUIGroup/UI_Classic'
# Integrate the search feature (To use this feature, you need to purchase the Premium edition)
pod 'TUISearch/UI_Classic'
# Integrate the offline push feature
pod 'TUIOfflinePush'
# Integrate the audio/video call feature
pod 'TUICallKit'

end

#Pods config
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
#Fix Xcode14 Bundle target error
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
config.build_settings['ENABLE_BITCODE'] = "NO"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
#Fix Xcode15 other links flag -ld64
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
if xcode_version >= 15
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
if xcconfig.include?("OTHER_LDFLAGS") == false
xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
else
if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
end
if xcconfig.include?("-ld64") == false
xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
end
end
File.open(xcconfig_path, "w") { |file| file << xcconfig }
end
end
end
end
Note
1. If you run pod 'TUIChat' without specifying the classic or minimalist version, the two versions of UI components will be integrated by default. 2. The classic and minimalist versions of UI components cannot be used together. If you integrate multiple components, all the integrated components must be of the same version: classic or minimalist. For example, the classic version TUIChat must be used together with the classic version TUIConversation, TUIContact, and TUIGroup, and the minimalist version TUIChat must be used together with the minimalist version TUIConversation, TUIContact, and TUIGroup. 3. If you use Swift, enable use_modular_headers! and change the reference of the header file to the reference format of @import module name.
1. Run the following command to install TUIKit.
pod install
If you cannot install the latest TUIKit version, run the following command to update the local CocoaPods repository list:
pod repo update
Then run the following command to update the Pod version of the component library:
pod update
After all TUIKit components are integrated, the project structure is as follows:



Note:
If you still encounter problems after the above operations, see Xcode 15 FAQs and CocoaPods FAQs.

Method 2: Local DevelopmentPods Integration

Note:
This method is recommended if no source code modification is needed.
1. Download the TUIKit source code from GitHub. Drag and drop the source code into your project directory: chat-uikit-ios/TUIKit.



2. Change the local path of each component in your Podfile to the path of the TUIKit folder relative to your project Podfile.
For example, pod 'TUICore', :path => "../TUIKit/TUICore" in the Demo.
Note:
In the example image, the TUIKit folder is in the parent directory of the Podfile. In this case, we use pod 'TUICore', :path => "../TUIKit/TUICore".
Other relative paths are as follows:
Parent directory: pod 'TUICore', :path => "../TUIKit/TUICore"
Current directory: pod 'TUICore', :path => "/TUIKit/TUICore"
Subdirectory: pod 'TUICore', :path => "../TUIKit/TUICore"
3. Run Pod update.
# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '13.0'
install! 'cocoapods', :disable_input_output_paths => true

# Replace `your_project_name` with your actual project name
target 'your_project_name' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
use_modular_headers!

# Note: To perform upgrade when using a local integration solution, you need to access
# https://github.com/TencentCloud/TIMSDK/tree/master/iOS/TUIKit
# to obtain the latest component code, and place it in the local specified directory, such as /TIMSDK/ios/TUIKit/TUICore.
# Note: When custom modifications conflict with remote changes, you need to manually merge them to resolve conflicts.
# Integrate the basic library (required)
pod 'TUICore', :path => "../TUIKit/TUICore"
pod 'TIMCommon', :path => "../TUIKit/TIMCommon"
# Integrate TUIKit components (optional)
# Integrate the chat feature
pod 'TUIChat', :path => "../TUIKit/TUIChat"
# Integrate the conversation list feature
pod 'TUIConversation', :path => "../TUIKit/TUIConversation"
# Integrate the relationship chain feature
pod 'TUIContact', :path => "../TUIKit/TUIContact"
# Integrate the group feature
pod 'TUIGroup', :path => "../TUIKit/TUIGroup"
# Integrate the search feature (To use this feature, you need to purchase the Ultimate edition)
pod 'TUISearch', :path => "../TUIKit/TUISearch"
# Integrate the audio/video call feature
pod 'TUICallKit'
# Integrate the video conference feature
pod 'TUIRoomKit'
# Integrate the TUIKitPlugin plugin (optional)
# Note: The TUIKitPlugin plugin version must be the same as the TUICore version.
# Ensure that the plugin version matches spec.version in "../TUIKit/TUICore/TUICore.spec".
# Integrate the voting plugin, supported from version 7.1
pod 'TUIPollPlugin', '7.6.5011'
# Integrate the group chain plugin, supported from version 7.1
pod 'TUIGroupNotePlugin', '7.6.5011'
# Integrate translation plugin, supported from version 7.2 (Value-added feature activation is required. Please contact Tencent Cloud sales)
pod 'TUITranslationPlugin', '7.6.5011'
# Integrate the session grouping plugin, supported from version 7.3
pod 'TUIConversationGroupPlugin', '7.6.5011'
# Integrate the session tagging plugin, supported from version 7.3
pod 'TUIConversationMarkPlugin', '7.6.5011'
# Integrate the offline push feature
pod 'TIMPush'
# Other Pods
pod 'MJRefresh'
pod 'Masonry'
end
#Pods config
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
#Fix Xcode14 Bundle target error
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
config.build_settings['ENABLE_BITCODE'] = "NO"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
#Fix Xcode15 other links flag -ld64
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
if xcode_version >= 15
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
if xcconfig.include?("OTHER_LDFLAGS") == false
xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
else
if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
end
if xcconfig.include?("-ld64") == false
xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
end
end
File.open(xcconfig_path, "w") { |file| file << xcconfig }
end
end
end
end
Note:
To perform upgrade when using a local integration solution, you need to access TUIKitDemo source code .
Obtain the latest component code and place it in a local directory, such as TIMSDK/iOS/TUIKit.
Note: When custom modifications conflict with remote changes, you need to manually merge them to resolve conflicts.
Note: The TUIKitPlugin plugin version must be the same as the TUICore version. Ensure that the plugin version matches spec.version in "../TUIKit/TUICore/TUICore.spec".
If you still encounter problems after the above operations, see Xcode 15 FAQs and CocoaPods FAQs.

Quick Build

Instant messaging software usually consists of several basic UIs such as the conversation list, chat window, contacts, and audio/video call UIs. It only takes a few lines of code to build these UIs in your project. The process is as follows:
Note
About TUIKit component features. If you want to learn more, you can download and run TUIKitDemo source code, where you can find samples of frequently used features.

Step 1. Log in to TUIKit

You need to log in to TUIKit before you can use the component features properly. To log in to TUIKit, click Login on your app. You need to create an app and obtain the SDKAppID in the Chat console. userSig needs to be calculated according to rules. For operation details, see Get Started.
Sample code:
#import "TUILogin.h"

- (void)loginSDK:(NSString *)userID userSig:(NSString *)sig succ:(TSucc)succ fail:(TFail)fail {
[TUILogin login:SDKAppID userID:userID userSig:sig succ:^{
NSLog(@"Login successful");
} fail:^(int code, NSString *msg) {
NSLog(@"Login failed");
}];
}

Step 2. Build the conversation list UI

To build the conversation list UI, you only need to create a TUIConversationListController object. The conversation list reads recent contacts from the database. When a user clicks a contact, TUIConversationListController calls back the didSelectConversation event to the upper layer.
Sample code:
Minimalist version
Classic version
#import "TUIConversationListController_Minimalist.h"

// ConversationController is your own ViewController
@implementation ConversationController
- (void)viewDidLoad {
[super viewDidLoad];
// TUIConversationListController_Minimalist
TUIConversationListController_Minimalist *vc = [[TUIConversationListController_Minimalist alloc] init];
vc.delegate = self;
// Add TUIConversationListController_Minimalist to your own ViewController
[self addChildViewController:vc];
[self.view addSubview:vc.view];
}

- (void)conversationListController:(TUIConversationListController_Minimalist *)conversationController
didSelectConversation:(TUIConversationCell *)conversation
{
// Conversation list click event, typically, opening the chat UI
}
@end
#import "TUIConversationListController.h"

// ConversationController is your own ViewController
@implementation ConversationController
- (void)viewDidLoad {
[super viewDidLoad];
// TUIConversationListController
TUIConversationListController *vc = [[TUIConversationListController alloc] init];
vc.delegate = self;
// Add TUIConversationListController to your own ViewController
[self addChildViewController:vc];
[self.view addSubview:vc.view];
}

- (void)conversationListController:(TUIConversationListController *)conversationController
didSelectConversation:(TUIConversationCell *)conversation
{
// Conversation list click event, typically, opening the chat UI
}
@end


Step 3. Build the chat panel

During chat panel initialization, the upper layer needs to pass in the conversation information of the current chat panel.
Sample code:
Minimalist version
Classic version
#import "TUIC2CChatViewController_Minimalist.h"

// ChatViewController is your own ViewController
@implementation ChatViewController
- (void)viewDidLoad {
// Create conversation information
TUIChatConversationModel *data = [[TUIChatConversationModel alloc] init];
data.userID = @"userID";
// Create TUIC2CChatViewController_Minimalist
TUIC2CChatViewController_Minimalist *vc = [[TUIC2CChatViewController_Minimalist alloc] init];
[vc setConversationData:data];
// Add TUIC2CChatViewController to your own ViewController
[self addChildViewController:vc];
[self.view addSubview:vc.view];
}
@end
Note
TUIC2CChatViewController_Minimalist will automatically pull and display the historical messages of the user.
#import "TUIC2CChatViewController.h"

// ChatViewController is your own ViewController
@implementation ChatViewController
- (void)viewDidLoad {
// Create conversation information
TUIChatConversationModel *data = [[TUIChatConversationModel alloc] init];
data.userID = @"userID";
// TUIC2CChatViewController
TUIC2CChatViewController *vc = [[TUIC2CChatViewController alloc] init];
[vc setConversationData:data];
// Add TUIC2CChatViewController to your own ViewController
[self addChildViewController:vc];
[self.view addSubview:vc.view];
}
@end
Note
TUIC2CChatViewController will automatically pull and display the historical messages of the user.

Step 4. Build the contacts panel

The contacts panel does not require other dependencies. You only need to create the object and display it.
Minimalist version
Classic version
#import "TUIContactController_Minimalist.h"

// ContactController is your own ViewController
@implementation ContactController
- (void)viewDidLoad {
// Create TUIContactController_Minimalist
TUIContactController_Minimalist *vc = [[TUIContactController_Minimalist alloc] init];
// Add TUIContactController_Minimalist to your own ViewController
[self addChildViewController:vc];
[self.view addSubview:vc.view];
}
@end
Note: The preceding code only initializes TUIContactController_Minimalist and displays it. For the click actions (such as clicking a friend and adding a friend) on the contacts UI, TUIKit will deliver them to the upper layer for processing through ``TUIContactControllerListener_Minimalist`.
@protocol TUIContactControllerListener_Minimalist <NSObject>
@optional
- (void)onSelectFriend:(TUICommonContactCell *)cell;
- (void)onAddNewFriend:(TUICommonTableViewCell *)cell;
- (void)onGroupConversation:(TUICommonTableViewCell *)cell;
@end
#import "TUIContactController.h"

// ContactController is your own ViewController
@implementation ContactController
- (void)viewDidLoad {
// Create TUIContactController
TUIContactController *vc = [[TUIContactController alloc] init];
// Add TUIContactController to your own ViewController
[self addChildViewController:vc];
[self.view addSubview:vc.view];
}
@end
Note: The preceding code only initializes TUIContactController and displays it. For the click actions (such as clicking a friend and adding a friend) on the contacts UI, TUIKit will deliver them to the upper layer for processing through TUIContactControllerListener.
@protocol TUIContactControllerListener <NSObject>
@optional
- (void)onSelectFriend:(TUICommonContactCell *)cell;
- (void)onAddNewFriend:(TUICommonTableViewCell *)cell;
- (void)onGroupConversation:(TUICommonTableViewCell *)cell;
@end
For example, when a user clicks a friend, the friend's profile page will be displayed:
Minimalist version
Classic version
#import "TUIFriendProfileController_Minimalist.h"

- (void)onSelectFriend:(TUICommonContactCell *)cell
{
TUICommonContactCellData *data = cell.contactData;
// Create the friend's profile
TUIFriendProfileController_Minimalist *vc = [[TUIFriendProfileController_Minimalist alloc] init];
vc.friendProfile = data.friendProfile;
// Display the friend's profile
[self.navigationController pushViewController:(UIViewController *)vc animated:YES];
}
#import "TUIFriendProfileController.h"

- (void)onSelectFriend:(TUICommonContactCell *)cell
{
TUICommonContactCellData *data = cell.contactData;
// Create the friend's profile
TUIFriendProfileController *vc = [[TUIFriendProfileController alloc] init];
vc.friendProfile = data.friendProfile;
// Display the friend's profile
[self.navigationController pushViewController:(UIViewController *)vc animated:YES];
}
Note
You can download TUIKitDemo source code and view the implementation of more contacts events.

Step 5. Build the audio/video call feature

TUI components allow users to start audio/video calls in chat UIs and can be quickly integrated with a few steps:
Video Call
Audio Call






1. Activate the TRTC service
2. Log in to the Chat console and click the target app card to go to the basic configuration page of the app.
3. Click Free trial under Activate Tencent Real-Time Communication (TRTC) to activate the 7-day free trial service of TUICallKit.
4. Click Confirm in the pop-up dialog box. A TRTC app with the same SDKAppID as the Chat app will be created in the TRTC console. You can use the same account and authentication information for Chat and TRTC.
5. Integrate the TUICallKit component. Add the following content to your Podfile:
// Integrate the TUICallKit component
pod 'TUICallKit'
6. Start and answer a video or audio call
Starting a Call via a Message Page
Starting a Call via a Contact Profile Page






After integrating the TUICallKit component, the chat UI and contact profile UI display the **Video Call** and **Audio Call** buttons by default. When a user clicks either of the buttons, TUIKit automatically displays the call invitation UI and sends the call invitation request to the callee.
When an online user receives a call invitation, TUIKit automatically displays the call receiving UI, where the user can answer or reject the call.
When an offline user receives a call invitation and wants to start the app to accept the call, the offline push capability is required. For how to implement offline push, see here.
7. Add offline push Before using offline push, you need to activate the Chat offline push service. For related app configuration, see Integrating TUIOfflinePush and Running the Offline Push Feature.
Note:
After the configuration is completed, when you click a received audio/video call notification pushed offline, TUICallKit automatically opens the audio/video call invitation UI.
8. Add value-added capabilities. After TUIChat and TUICallKit are integrated, when you send a voice message on the chat UI, the voice message can be recorded with AI-based noise reduction and automatic gain control. This feature relies on the audio/video call capability of higher-level plans, which is supported in Chat SDK 7.0 and later versions. If the dependent plan expires, voice message recording is switched to the system API. The following compares the voice messages recorded simultaneously using two Huawei P10 phones:
Voice Message Recorded by the System
Voice Message with AI-based Noise Reduction and Automatic Gain Control Recorded by TUICallkit



Third-Party Library Dependency

The earliest versions of third-party libraries that TUIKit depends on are as follows. If your version is too early, upgrade it to the latest version.
- Masonry (1.1.0)
- MJExtension (3.4.1)
- MJRefresh (3.7.5)
- ReactiveObjC (3.1.1)
- SDWebImage (5.18.11):
- SDWebImage/Core (= 5.18.11)
- SDWebImage/Core (5.18.11)
- SnapKit (5.6.0)
- SSZipArchive (2.4.3)

FAQs

TUICallKit Issues

What Should I Do If TUICallKit Conflicts with an Audio/Video Library That I Have Integrated?
Do not integrate different Tencent Cloud audio and video libraries at the same time to prevent symbol conflicts. You can handle it as follows:
1. If you use the TXLiteAVSDK_TRTC library, no symbol conflict will occur. You can directly add the dependency to the Podfile.
pod 'TUICallKit'
2. If you use the TXLiteAVSDK_Professional library, a symbol conflict will occur. You can add the dependency to the Podfile.
pod 'TUICallKit/Professional'
3. If you use the TXLiteAVSDK_Enterprise library, a symbol conflict will occur. It is recommended that you upgrade the version to TXLiteAVSDK_Professional and then use TUICallKit/Professional.

What should I do when I receive the message "target has transitive dependencies that include statically linked binaries"?
If this error occurs during the pod process, this is because TUIKit is using a third-party static library. You need to comment out use_frameworks! in your Podfile.
If you need to use use_frameworks!, use CocoaPods 1.9.0 or a later version for pod install and modify it as follows:
use_frameworks! :linkage => :static
If you use Swift, change the reference of the header file to the reference format of @import module name.

How long is the default call invitation timeout duration?
The default call invitation timeout duration is 30 seconds.

Will an invitee receive a call invitation immediately if the invitee goes offline and then online within the call invitation timeout duration?
1. If the call invitation is started in a one-to-one chat, the invitee can receive the call invitation, and the TUIKit will automatically open the call invitation UI internally.
2. If the call invitation is started in a group chat, the TUIKit will automatically pull the call invitations of the last 30 seconds and open the group call UI.

Xcode 15 Issues

[Xcodeproj] Unknown Object Version (60). (RuntimeError)

When you use Xcode 15 to create a project to integrate TUIKit, entering pod install may result in this issue. The reason is that an earlier version of CocoaPods is used. The following two solutions are available:
Solution 1: Change the Project Format version of the Xcode project.

Solution 2: Upgrade the local version of CocoaPods. The upgrading method is not covered in this document.
You can enter pod --version in the terminal to check the current version of Pods.
-ld64 Linker Issue
Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp.

Or when you use XCode 15 to integrate TUIRoom, if the latest linker causes symbol conflicts with TUIRoomEngine, it is an -ld64 linker issue.

Solution: Modify the linker configuration
Add "-ld64" to Other Linker Flags in Build Settings to resolve the issue. For more information, see https://developer.apple.com/forums/thread/735426.

Rosetta Emulator Issue
When you use Apple chips (M1/M2 series chips), the issue may arise because third-party libraries (including SDWebImage) do not support xcframework. However, Apple has provided a workaround, which is to enable Rosetta setting on the emulator. Generally, the Rosetta option will pop up automatically during compilation.

Xcode 15 Developer Sandbox Option Issue
Sandbox: bash(xxx) deny(1) file-write-create

When using Xcode 15 to create a project, you may encounter compilation failures due to this option. It is recommended that you disable this option.


CocoaPods Issues

Pod Dependency Version Mismatch During Remote Integration
If you use remote Pods integration, and the Podfile.lock file is inconsistent with the version of TUICore that the plugins depend on, delete the Podfile.lock file, run pod repo update to update the local code repository, and then run pod update to update it again.

Pod Dependency Version Mismatch During Local Integration
When you use DevelopPods for integration, if the version of TUICore that the plugins depend on is late but the local Pod dependency version is 1.0.0,see Podfile_local and TUICore.spec. The plugin versions must be the same as that in TUICore.spec. In general, we change them to be the same.When you use local integration for the first time, it is recommended that you download our sample Demo project, replace the content of Podfile with the content of Podfile_local, and run Pod update for cross-reference.