• UIKit
  • SDK
  • 서버 API
Chat/
SDK/
iOS and macOS/
설치/
SDK
  • 설치
    • iOS
    • macOS
  • Chat SDK 초기화
  • 로그인 및 로그아웃
  • 메시지
    • 개요
    • 메시지 보내기
    • 메시지 받기
    • 메시지 검색
    • 메시지 전달
    • 메시지 수정
    • 삽입 메시지
    • 메시지 삭제
    • 과거 메시지 비우기
    • 메시지 철회
    • 온라인 메시지 보내기
    • 메시지 읽음 확인
    • 메시지 조회
    • 알림
    • Targeted Group Messages
    • 알림 차단
    • Key-Value 확장
    • 반응
    • 번역
    • 메시지 최상단 고정
  • 대화
    • 개요
    • 대화 목록
    • 대화 획득
    • 읽지 않은 메시지 수
    • 대화 최상단 고정
    • 대화 삭제
    • 초안
    • 마크
    • 대화 그룹
  • 그룹
    • 개요
    • 그룹 관리
    • 정보
    • 멤버 관리
    • 멤버 정보
    • 속성
    • 카운터
  • 커뮤니티 및 화제
    • 커뮤니티 관리
    • 권한 그룹
  • 사용자
    • 사용자 정보
    • 사용자 상태
    • 친구 관리
    • 친구 그룹화
    • 블록리스트
    • Follow
  • 국부 검색
    • 메시지 검색
    • 친구 검색
    • 그룹 검색
    • 그룹 멤버 검색
  • 시그널링
  • 인터페이스 참고 문서
    • Swift
    • Objective-C
  • Guideline for Beginners
  • 콘솔 안내
    • 애플리케이션 생성 및 업그레이드
    • 기본 구성
    • 기능 구성
    • 계정 관리
    • 그룹 관리
    • 콜백 구성
  • 제품 소개
    • 메시지 관리
      • 1대1 메시지
      • 메시지 저장
      • 오프라인 푸시
      • 그룹 메시지
      • 메시지 포맷
    • 계정 시스템
      • 로그인 인증
      • 온라인 상태 관리
    • 그룹 관련
      • 그룹 시스템
      • 그룹 관리
    • 사용자 정보 및 관계망
      • 정보 관리
      • 관계망 관리
  • 구매 가이드
    • 과금 개요
    • 가격
  • 에러코드
이 페이지는 현재 영어로만 제공되며 한국어 버전은 곧 제공될 예정입니다. 기다려 주셔서 감사드립니다.

iOS

This document describes how to quickly integrate the Chat SDK to your projects.

Environment Requirements

Xcode 9.0+.
iPhone or iPad on iOS 8.0 or above.
Your project has a valid developer signature.

Integrating SDK

You can either automatically integrate SDK using CocoaPods, or manually download the SDK and import it to your current project.

CocoaPods

1. Install CocoaPods

Enter the following command in the terminal window (you need to install the Ruby environment on your macOS in advance):
sudo gem install cocoapods

2. Create a Podfile

Go to the path where the project is located and run the following command. Then, a Podfile will appear under the project path.
pod init

3. Edit the Podfile

Add the dependency to your Podfile:
platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'

target 'App' do
# Add the SDK
pod 'TXIMSDK_Plus_iOS'
# pod 'TXIMSDK_Plus_iOS_XCFramework'
# pod 'TXIMSDK_Plus_Swift_iOS_XCFramework'

# If you need to add the Quic plugin, please uncomment the next line.
# Note:
# - This plugin must be used with the TXIMSDK_Plus_iOS or TXIMSDK_Plus_iOS_XCFramework edition of the IM SDK, and the plugin version number must match the IM SDK version number. # - For the TXIMSDK_Plus_Swift_iOS_XCFramework edition, there is no need to add this plugin. If you need to use the Quic feature in this edition, please contact us.
# pod 'TXIMSDK_Plus_QuicPlugin'
end

4. Install the SDK or update the local repository.

Run the following command in the terminal window to update the local library file and install the Chat SDK:
pod install
Or, run the following command to update the local repository:
pod update
After the pod command is executed, an .xcworkspace project file integrated with the SDK will be generated. Double-click this file to open it. If the pod search fails, you are advised to update the local repo cache of the pod by running the following commands:
pod setup
pod repo update
rm ~/Library/Caches/CocoaPods/search_index.json
Note:
Quic plugin provides axp-quic multiplexing protocol, which has better weak network resistance and can still provide services even when the network packet loss rate reaches 70%. This plugin is only available on the Chat Premium edition, purchase the Premium edition to use it. To ensure proper functionality, please update the client SDK to version 7.7.5282 or higer.
If you need to use the Quic feature in the Swift edition of the SDK, please contact us through the Telegram technical group.

Manual integration

1. Download the SDK

Download the latest SDK version from Github.ImSDK_Plus.framework are the core dynamic library files of the SDK.

2. Create a project

Create a project.

Enter a project name, for example, IMDemo.


3. Integrate the SDK

Add the dependency library: select Target for IMDemo. On the General panel, add the dependency library under Embedded Binaries and Linked Frameworks and Libraries, select ImSDK_Plus.framework.

Set link parameters: add -ObjC in Build Setting -> Other Linker Flags.
Note:
For manual integration, you need to change ImSDK_Plus.framework to Embed&Sign in Target -> General -> Frameworks -> Libraries and Embedded Content.
If you need to add a Quic plugin, please refer to the previous steps and manually download the integrated Quic plugin.

Import SDK

There are two ways to use the SDK in your project code.

Method 1

Choose Xcode -> Build Setting -> Header Search Paths, and set the SDK header file path. In files that require the SDK API, reference the corresponding header file.
#import "ImSDK_Plus.h"

Method 2

In files that require the SDK API, reference the corresponding header file.
#import <ImSDK_Plus/ImSDK_Plus.h>

FAQs

[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.
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.