This document describes how to quickly run the IM demo for iOS.
Note:If you already have an app, record its SDKAppID and obtain key information.
A Tencent Cloud account can create a maximum of 300 IM apps. If you want to create a new app, disable and delete an unwanted app first. Once an app (along with its SDKAppID) is deleted, the provided service and all its data are lost. Please proceed with caution.
Note:Please store the key information properly to prevent disclosure.
Note:To respect the copyright of emoji design, the downloaded demo project does not contain sliced images of major emoji elements. You can use your local emoji packs to configure code. Unauthorized use of the emoji pack in the IM demo may infringe on the design copyright.
GenerateTestUserSig
file in the following paths:GenerateTestUserSig
file:Note:In this document, the method to obtain
UserSig
is to configure aSECRETKEY
in the client code. In this method, theSECRETKEY
is vulnerable to decompilation and reverse engineering. Once yourSECRETKEY
is disclosed, attackers can steal your Tencent Cloud traffic. Therefore, this method is only suitable for locally running a demo project and feature debugging.
The correctUserSig
distribution method is to integrate the calculation code ofUserSig
into your server and provide an app-oriented API. WhenUserSig
is needed, your app can send a request to the business server to obtain a dynamicUserSig
. For more information, see Generating UserSig on the Server.
See the file README.md
in the corresponding directory of the demo project cloned in Step 3.
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 gem sources.
gem sources --remove https://rubygems.org/
gem sources --add https://gems.ruby-china.com/
// Install pod.
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
Run the following commands on the terminal to install dependent libraries:
// iOS
cd iOS/TUIKitDemo
pod install
// macOS
cd Mac/TUIKitDemo
pod install
If installation fails, run the following command to update the local CocoaPods repository list:
pod repo update
Compile and run the demo:
TUIKitDemo.xcworkspace
to compile and run the demo.TUIKitDemo.xcworkspace
to compile and run the demo.Note:The demo is integrated with the audio/video call feature by default. However, the TRTC SDK on which the audio/video call feature relies currently does not support simulators. Please use real devices for demo running or debugging.
Was this page helpful?