TUICallKit
component. Performing the following key steps generally takes about an hour, after which you can implement the video call feature with complete UIs.Podfile
.pod 'TUICallKit_Swift'
pod 'TUICallKit'
pod install
TUICallKit
cannot be installed, run the following command to update the local CocoaPods repository list:pod repo update
pod update
Info.plist
of your app. Their content is what users see in the mic and camera access pop-up windows.<key>NSCameraUsageDescription</key><string>CallingApp needs to access your camera to capture video.</string><key>NSMicrophoneUsageDescription</key><string>CallingApp needs to access your mic to capture audio.</string>
TUICallKit
componentTUICore
to log in to the TUICallKit
component. This step is very important, as the user can use the component features properly only after a successful login. Carefully check whether the relevant parameters are correctly configured:import TUICoreTUILogin.login(1400000001, // Replace it with the `SDKAppID` obtained in step 1.userID: "denny", // Replace it with your `UserID`.userSig: "xxxxxxxxxxx") { // You can calculate a `UserSig` in the console and enter it here.print("login success")} fail: { (code, message) inprint("login failed, code: \\(code), error: \\(message ?? "nil")")}
#import <TUICore/TUILogin.h>[TUILogin login:1400000001 // Replace it with the `SDKAppID` obtained in step 1.userID:@"denny" // Replace it with your `UserID`.userSig:@"xxxxxxxxxxx" // You can calculate a `UserSig` in the console and enter it here.succ:^{NSLog(@"login success");} fail:^(int code, NSString *msg) {NSLog(@"login failed, code: %d, error: %@", code, msg);}
login
function are as detailed below:SDKSecretKey
to encrypt the information such as SDKAppID
and UserID
. You can generate a temporary UserSig
by clicking the UserSig Generate button in the console.genTestUserSig
function to calculate UserSig
locally, so as to help you complete the current integration process more quickly. However, this scheme exposes your SecretKey
in the application code, which makes it difficult for you to upgrade and protect your SecretKey
subsequently. Therefore, we strongly recommend you run the UserSig
calculation logic on the server and make the application request the UserSig
calculated in real time every time the application uses the TUICallKit
component from the server.TUICallKit.createInstance().setSelfInfo(nickname: "nickname", avatar: "profile photo URL") {} fail: { code, message in}
[[TUICallKit createInstance] setSelfInfo:@"nickname" avatar:@"profile photo URL" succ:^{} fail:^(int code, NSString *errMsg) {}];
import TUICallKit// Initiate a 1-on-1 video call (suppose the `userId` is `mike`)TUICallKit.createInstance().call(userId: "mike", callMediaType: .video)
#import <TUICallKit/TUICallKit.h>// Initiate a 1-on-1 video call (suppose the `userId` is `mike`)[[TUICallKit createInstance] call:@"mike" callMediaType:TUICallMediaTypeVideo];
| |
Caller | Callee |
TUICallKit
.
Was this page helpful?