Import TUIKit (iOS)

Last updated: 2020-10-26 15:32:03

    Development Environment Requirements

    • Xcode 10 or later
    • iOS 8.0 or later

    Integration Description

    CocoaPods integration (recommended)

    TUIKit supports CocoaPods integration and manual integration. We recommend CocoaPods integration because it enables upgrades to the latest version at any time.

    1. Add the following content in Podfile.

      #use_frameworks!   // This configuration needs to be shielded because TUIKit uses third-party static libraries.
      install! 'cocoapods', :disable_input_output_paths => true  // This statement is needed to avoid conflict because TXIMSDK_TUIKit_live_iOS uses a `*.xcassets` resource fie. 
      
      pod 'TXIMSDK_TUIKit_iOS'                 // Integrate the chat, relationship chain and group features, which depends on the audio and video library of TXLiteAVSDK_TRTC by default
      // pod 'TXIMSDK_TUIKit_iOS_Professional' // Integrate the chat, relationship chain and group features, which depends on the audio and video library of TXLiteAVSDK_Professional by default
      pod 'TXIMSDK_TUIKit_live_iOS'         // Integrate group livestreaming and live room list features, which depends on the audio and video library of TXLiteAVSDK_TRTC by default
      // pod 'TXIMSDK_TUIKit_iOS_Professional' // Integrate group livestreaming and live room list features, which depends on the audio and video library of TXLiteAVSDK_Professional by default

      The Tencent Cloud audio and video library cannot be integrated at the same time due to symbol conflicts. If you use a non-TRTC version of an audio and video library, we recommend that you remove it first and then integrate the TXIMSDK_TUIKit_iOS_Professional version into the pod. This version of the LiteAV_Professional audio and video library includes all basic audio and video capabilities.

    2. Run the following command to install TUIKit.

      pod install

      If installation of the latest SDK version fails, run the following command to update the local CocoaPods repository list:

      pod repo update

    Manual integration (not recommended)

    1. In Framework Search Path, add the file path of ImSDK, and manually add the TUIKit and ImSDK directories to your project.
    2. Manually add the third-party libraries used by TUIKit to your project:

    Importing TUIKit

    1. Import TUIKit to the AppDelegate.m file and initialize it.
      #import "TUIKit.h"
      
      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
          [[TUIKit sharedInstance] setupWithAppId:sdkAppid]; // SDKAppID can be obtained in the IM Console.
      }
    2. Save and compile it.
      If the compilation is successful, the integration is completed. If the compilation fails, check the failure cause or re-perform the integration according to the instructions in this document.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help