Home
/
Chat
/
iOS

Install and configure the Chat SDK

This page provides a step-by-step guide that demonstrates how to build and configure an in-app chat using Sendbird Chat SDK. Sendbird Chat SDK can be installed through either CocoaPods or Carthage.


Step 1: Create a Sendbird application from your dashboard

A Sendbird application comprises everything required in a chat service including users, message, and channels. To create an application:

  1. Go to the Sendbird Dashboard and enter your email and password, and create a new account. You can also sign up with a Google account.
  2. When prompted by the setup wizard, enter your organization information to manage Sendbird applications.
  3. Lastly, when your dashboard home appears after completing setup, click Create + at the top-right corner.

Only one Sendbird application can be integrated per app for your service regardless of the platform. All users within your Sendbird application can communicate with each other across all platforms. This means that your iOS, Android, and web client app users can all send and receive messages with one another without any further setup.

Note: All data is limited to the scope of a single application, and users in different Sendbird applications can't chat with each other.


Step 2: Install the Chat SDK

Installing the Chat SDK is simple if you’re familiar with using external libraries or SDK’s in your projects. You can install the Chat SDK using CocoaPods or Carthage like the following.

With CocoaPods

If you've never used CocoaPods for a Xcode project, open a terminal window, move to your project directory, and then create a Podfile by running the following command.

Light Color Skin
Copy
$ pod init

Add the following lines to the Podfile.

Light Color Skin
Copy
platform :ios, '8.0'

target 'YourProject' do
    use_frameworks!

    pod 'SendBirdSDK'
end

And then install the SendBird framework through CocoaPods.

Light Color Skin
Copy
$ pod install

Now you can run your project with the SendBird framework by opening *YOUR_PROJECT*.xcworkspace. If you don't want to use CocoaPods, check out the manual installation guide.

With Carthage

  1. Add github "sendbird/sendbird-ios-framework" to your Cartfile.
  2. Run carthage update.
  3. Go to your Xcode project's General settings tab. Open the <YOUR_XCODE_PROJECT_DIRECTORY>/Carthage/Build/iOS in the Finder window and drag SendBirdSDK.framework to the Embedded Binaries section in Xcode. Make sure the Copy items if needed option is selected and click Finish.

Turn on ARC

To use the SendBird framework, you should turn on the ARC (Automatic Reference Counting). To do that, go to your project's Build Settings, and then set the value of Objective-C Automatic Reference Counting to Yes (in Swift, Yes by default).

If you don't want to turn on ARC in a project-wide scope, then navigate to the Build Phases - Compile Sources and add -fobjc-arc to the Compiler Flags in the source file that the SendBird framework uses. This means that ARC is turned on only that file.


Step 3: Use the Chat SDK in Objective-C and Swift

You can use all classes and methods just with the following one import statement, without a bridging header file, in both Objective-C and Swift.

Objective-C
Swift
Light Color Skin
Copy
#import <SendBirdSDK/SendBirdSDK.h>
Light Color Skin
Copy
import SendBirdSDK

The Interacting with Objective-C APIs in Swift helps you with understanding how to use the Chat SDK in Swift syntax.