Sendbird UIKit for iOS is a set of prebuilt UI components that allows you to easily craft an in-app chat with all the essential messaging features. Our development kit includes light and dark themes, text fonts, colors and more. You can customize these components to create an interactive messaging interface unique to your brand identity.
The minimum requirements for UIKit for iOS are:
iOS 10.3 and later
Sendbird Chat SDK for iOS 3.0.216 and later
You can start building a modern messaging experience in your app by installing Sendbird UIKit. This developer kit is an add-on feature to Sendbird Chat SDK so installing it will also install the core Chat SDK. The minimum requirement of Chat SDK for iOS is 3.0.216 or later.
To get started, open
Xcode and create a new project. Sendbird UIKit supports both
Podfilein Xcode as below:
- Install the
- Update the
- Install the
Note: Building or creating the
Carthagecan only be done using the latest
Swift. If your
Swiftis not the most recent version, the framework should be copied into your project manually.
Go to your Xcode project target's General settings tab in the
Frameworks and Librariessection. Then drag and drop on the disk each framework from the
Go to your Xcode project target's Build Phases settings tab, click the + icon, and choose New Run Script Phase. Create a
Run Script, specify your shell (ex: /bin/sh), and add
/usr/local/bin/carthage copy-frameworksto the script below the shell.
Add the following paths to the
Note: Errors may occur if you're building your project with Xcode 11.3 or earlier versions. To fix these errors, refer to Handle errors caused by unknown attributes in the sample app.
A Sendbird application comprises everything required in a chat service including users, channels, and messages. To create an application:
- Go to Sendbird Dashboard and enter your email and password to create a new account. You can also sign up with a Google account.
- When prompted by the setup wizard, enter your organization information to manage Sendbird applications.
- Then when your dashboard home appears after completing the setup process, click Create + at the top-right corner.
- Once you've created a new application, go to Users and click Create user + at the top-right corner. This step is necessary in order to create a group channel and send a message.
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 send and receive messages with each other without any further setup. However, users in different Sendbird applications can't chat with each other as all data is limited to the scope of a single application.
To integrate and run Sendbird UIKit in your application, you need to initialize it first. Initialize the
SendBirdUIKit instance through
User information must be set as
CurrentUser in the
SBUGlobals prior to launching Sendbird UIKit. This information will be used for various tasks within the kit, and if you don't set
CurrentUser in advance, there will be restrictions in your usage. The
userID field shown below must be specified. Other fields such as
profileUrl are optional, and if not specified, they'll be filled with default values.
CurrentUser for UIKit through the
AppDelegate as below:
Note: Even if you don't use
AppDelegate, you should still register user information before launching a chat service.
SBUChannelListViewController is the starting point for launching UIKit in your application. By implementing the code below, you will see a complete list of group channels that you're a member of.
You can now run the application on a simulator or a plugged-in device. To send a message, you must first create a group channel by clicking on the icon in the top-right corner. Then, you can select users you wish to invite as members to your channel. Once the channel has been created, type your first message and press send.
Note: Sendbird UIKit offers features to attach or save files such as photos, videos, and documents in addition to sending text messages. To learn more about using those features, refer to Get attachment permission in the sample app.
You've successfully sent your first message with Sendbird.
Note: If you wish to distribute your application in the App store and remove unnecessary architectures in the application's build phase, go to Distribution settings in the sample app.
UIKit for iOS manages the lifecycle of its
ViewController along with various views and data from the Chat SDK for iOS. UIKit components are as follows:
A singleton that manages themes.
A singleton that manages color sets.
A singleton that manages font sets.
A class that contains static functions required when using Sendbird UIKit.
A class that contains static attributes required when using Sendbird UIKit.