Create your first ticket
Sendbird Desk SDK for iOS lets you easily initialize, configure, and build the customer-support related functionalities to a client app. When a customer asks for help through live, in-app support built with the Desk SDK, agents receive those messages as tickets and can start a conversation on the Sendbird Dashboard. This page walks you through the quick steps to create your first ticket by installing and initializing the Desk SDK.
Note: As Sendbird Desk works based on Sendbird Chat, the interaction between users is built and provided by Sendbird Chat.
Requirements
The requirements of the Desk SDK for iOS are as below:
- iOS 12.0 or later
Xcode 15.0 or later
Sendbird Chat SDK for iOS 4.19.0 and later
Prerequisite
Before installing Sendbird Desk SDK, you will need an account on Sendbird Dashboard. Sign up to create a Sendbird application first.
Note: A Sendbird application gets paired up with one client app. Agents can support customers across all platforms, but customers from different Sendbird applications are excluded because all data is limited to the scope of a single application.
Get started
Step 1 Install using CocoaPods
You can install the Desk SDK for iOS using CocoaPods.
- Add
SendBirdDesk
into yourPodfile
in Xcode as below:
- Run
pod install
. - Open
YOUR_PROJECT.xcworkspace
.
Step 2 Initialize the Desk SDK
- Initialize the
SBDSKMain
instance when launching a client app. - Copy
APP_ID
of your Sendbird application from the dashboard. The sameAPP_ID
must be used for both Chat and Desk SDKs. - Call the
SendbirdChat.initialize(params:)
method using the copiedAPP_ID
withinapplicationDidFinishLaunching()
. - Call the
SBDSKMain.initializeDesk()
method withinapplicationDidFinishLaunching()
.
Note: If you call
SBDSKMain.initializeDesk()
again after callingSendbirdChat.initialize(params:)
with a differentAPP_ID
, all existing Desk-related data in the client app will be deleted.
Step 3 Authenticate a customer from Sendbird Chat
Every ticket in Sendbird Desk is mapped to a group channel in Sendbird Chat SDK because messages within a ticket are handled by Sendbird Chat SDK. Therefore, a customer needs an authentication both within the Chat SDK and the Desk SDK to receive and send a message within a ticket. Use the SendbirdChat.connect()
and the SBDSKMain.authenticate()
methods with a customer's user ID used in Sendbird Chat SDK to authenticate a customer.
Step 4 Create your first ticket
Implement the SBDSKTicket.createTicket()
method to create a new ticket either before or after the customer’s initial message. Once a ticket is successfully created on the Desk server, you can access the ticket and its channel in ticket.channel
through the callback from the server. Until a customer sends the first message, agents can’t see the ticket on the dashboard. When a conversation starts, the ticket is assigned to an available agent by the Desk server while messages are sent and received through the Chat SDK.
Note: Because the
SendbirdChat
instance in a client app is connected to the Sendbird server, Desk-related events are delivered to the Chat SDK's event delegates. The event delegates receive callbacks from the server throughchannel(_:didReceive:)
,channel(_:userDidEnter:)
, and other event callback methods.