Skip to content

jianfma/chat-uikit-ios

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 简体中文

Instant Messaging

Product Introduction

Build real-time social messaging capabilities with all the features into your applications and websites based on powerful and feature-rich chat APIs, SDKs and UIKit components.

iOS Experience App

TUIKit is a UI component library based on Tencent Cloud IM SDK. It provides universal UI components to offer features such as conversation, chat, search, relationship chain, group, and audio/video call features.

Explore more docs about Tencent Cloud Chat.

Run through Demo

This document introduces how to quickly run through the Chat demo on the iOS platform. For the other platforms, please refer to document:

chat-uikit-android

chat-uikit-flutter

chat-uikit-vue

chat-uikit-react

chat-uikit-uniapp

chat-uikit-wechat

Step 1. Create an App

  1. Log in to the Chat Console.

If you already have an app, record its SDKAppID and configure the app.

  1. On the Application List page, click Create Application.
  2. In the Create Application dialog box, enter the app information and click Confirm. After the app is created, an app ID (SDKAppID) will be automatically generated, which should be noted down.

Step 2: Obtain Key Information

  1. Click Application Configuration in the row of the target app to enter the app details page.
  2. Click View Key and copy and save the key information.

Please store the key information properly to prevent leakage.

Step 3: Download and Configure the Demo Source Code

  1. Clone the Chat demo project from GitHub.
  2. Open the project in the terminal directory and find the GenerateTestUserSig file.
Platform Relative Path to File
Android Android/Demo/app/src/main/java/com/tencent/qcloud/tim/demo/signature/GenerateTestUserSig.java
iOS iOS/Demo/TUIKitDemo/Private/GenerateTestUserSig.h
  1. Set relevant parameters in the GenerateTestUserSig file:
  • SDKAPPID: set it to the SDKAppID obtained in Step 1.
  • SECRETKEY: enter the key obtained in Step 2. 487fe57e41ae261f3bbf86c830584afa

! In this document, the method to obtain UserSig is to configure a SECRETKEY in the client code. In this method, the SECRETKEY is vulnerable to decompilation and reverse engineering. Once your SECRETKEY is leaked, attackers can steal your Tencent Cloud traffic. Therefore, this method is only suitable for locally running a demo project and feature debugging. The correct UserSig distribution method is to integrate the calculation code of UserSig into your server and provide an application-oriented API. When UserSig is needed, your app can send a request to the business server for a dynamic UserSig. For more information, please see How do I calculate UserSig on the server?.

Step 4: Compile and Run the Demo (All Features)

  1. Run the following command on the terminal to check the pod version:
pod --version

If the system indicates that no pod exists or that the pod version is earlier than 1.7.5, run the following commands to install the latest pod.

// Change sources.
gem sources --remove https://rubygems.org/
gem sources --add https://gems.ruby-china.com/
// Install pods.
sudo gem install cocoapods -n /usr/local/bin
// If multiple versions of Xcode are installed, run the following command to choose an Xcode version (usually the latest one):
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
// Update the local pod library.
pod setup
  1. Run the following commands on the terminal to load the IMSDK library.
cd iOS/Demo
pod install
  1. If installation fails, run the following command to update the local CocoaPods repository list:
pod repo update
  1. Execute the following command to update the Pod version of the component library:
pod update
  1. Go to the iOS/Demo folder and open TUIKitDemo.xcworkspace to compile and run the demo.

Step 5: Compile and Run the Demo (Removing the Audio/Video Call Feature)

If you do not need the audio/video call feature, remote it as follows:

  1. Go to the iOS/Demo folder, comment out the TUICallKit pod in the Podfile, and run the pod install command.
#  pod 'TUICallKit' (Stop integrating the library)
  1. Go to the Building Settings page of the TUIKitDemo and set ENABLECALL to 0 to disable audio/video call related logic.

After the preceding steps are completed, the audio and video call entries in the demo are hidden.

The conversation UIs before and after TUICallKit masking are as follows:

before After
GitHub_ChatIncludeCallMinimalist GitHub_ChatExcludeCallMinimalist

The contact profile UIs before and after TUICallKit masking are as follows:

before After
GitHub_ContactIncludeCallMinimalist GitHub_ContactExcludeCallMinimalist

The above only shows how to remove the audio/video call feature from the demo. Developers can customize the demo according to their business requirements.

Step 6: Compile and Run the Demo (Removing the Search Feature)

Go to the iOS/Demo folder, comment out the TUISearch pod in the Podfile, and run the pod install command.

#  pod 'TUISearch' (Stop integrating the library)

After the preceding steps are completed, the message search box in the demo is hidden.

The message UIs before and after TUISearch masking are as follows:

before After
GitHub_ConversationIncludeSearchMinimalist GitHub_ConversationExcludeSearchMinimalist

The above only shows how to remove the search feature from the demo. Developers can customize the demo according to their business requirements.

About

Tencent Cloud Chat UI Components For iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 83.7%
  • Swift 14.8%
  • Ruby 1.2%
  • Other 0.3%