Articles in this section
Category / Section

How to Configure and Integrate SDK in Your iOS app

Updated:

Integrating the BoldDesk Chat SDK into your iOS application enables you to provide a seamless and engaging chat experience for your users. With this SDK, customers can connect with support agents in real time, ensuring faster responses and improved satisfaction.

This guide offers clear, step-by-step instructions to configure and integrate the BoldDesk Chat SDK into your iOS application, including installation and push notification setup. By completing this integration, you’ll enable your users to:

  • Engage in real-time conversations with your support agents.
  • Share files, screenshots, or documents directly within the chat for faster issue resolution.
  • Enjoy a fully branded, customizable chat interface that aligns with your app’s design.
  • Receive instant notifications for new chat messages, ensuring they never miss an update.

Whether you’re launching a new app or enhancing an existing one, the BoldDesk Chat SDK ensures a seamless, professional support experience—right inside your mobile application.

SDK Installation

Add SDK dependency

Add the following line to your Podfile under your app target:

target 'YourAppTarget' do
  use_frameworks!
  pod 'bolddesk_chat_sdk', '~> {latest-version}'
end

Then install the SDK using the pod install or pod update command in the terminal. You can find the latest package version here iOS Package

Import SDK

In your AppDelegate or the file where you want to use the SDK:

import BoldDeskChatSDK

Add the below keys in Info.plist of your app

<key>NSCameraUsageDescription</key>
<key>NSMicrophoneUsageDescription</key>
<key>NSPhotoLibraryUsageDescription</key>

Configuration Methods

Configure SDK

Initialize once in your application class or before using SDK features.

BDChatSDK.configure(
    appKey: "Your AppKey",
    brandUrl: "yourdomain.bolddesk.com"
)

Show Chat

Launches the BoldDesk chat interface inside your app, allowing users to start or continue conversations with support agents.

BDChatSDK.showChat()

Close Chat

Closes the active chat window and returns the user to the app interface.

BDChatSDK.closeChat()

User Profile Configuration

Use these methods to associate user details with the conversation.

// Set the user’s email address for chat initiation
BDChatSDK.setUserEmail("user@example.com") 

// Define the display name shown to agents during chat interactions
BDChatSDK.setUserName("John Doe") 

// Add the user’s phone number for follow-ups or verification
BDChatSDK.setUserPhoneNo("9876543210") 

// Configure a secure token to authenticate the user session 
BDChatSDK.setUserToken("your_token_here")

Clear Session

Resets the current chat session, removing user-specific data and cached information.

BDChatSDK.clearSession()

UI Customization

Theme Modes

Mode Description Code snippet
Light Forces light mode BDChatSDK.setPreferredTheme(SDKTheme.light)
Dark Forces dark mode BDChatSDK.setPreferredTheme(SDKTheme.dark)
System Default Follow system theme BDChatSDK.setPreferredTheme(SDKTheme.system)

Font Customization

The SDK supports custom fonts defined in your main application.

Include Font Files

  • Add the .ttf font file to your project
  • Add font name in Info.plist under UIAppFonts

Register Fonts in Code

BDChatSDK.customFontName = "Inter" or "Roboto" // font name

Fallback

If no custom font is set, SDK will use your app theme’s default typeface.

Push Notification Integration

The SDK supports push notifications using Firebase Cloud Messaging (FCM) to alert users about ticket updates and responses.

Add Firebase to Your iOS Project

• Go to Firebase Console Add Firebase to your iOS project
• Add a new iOS app and register it with your Bundle Identifier
• Download the generated GoogleService-Info.plist file
• Add the file to your project
• Add Firebase dependencies in your Podfile

pod 'FirebaseCore'
pod 'FirebaseMessaging'

Register push notifications

To register push notifications, include the following code snippet in the didReceiveRegistrationToken of AppDelegate class.

func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
        BDChatSDK.enablePushNotification(fcmToken: fcmToken)
    }

Handling push notifications

To handle push notifications, include the following code snippet in the didReceiveRemoteNotification of main class.

    func userNotificationCenter(_ center: UNUserNotificationCenter,didReceive response: UNNotificationResponse,withCompletionHandler completionHandler: @escaping () -> Void) {
        let userInfo = response.notification.request.content.userInfo
          if BDChatSDK.isFromChatSDK(userInfo: userInfo) {
                BDChatSDK.showChat()
            }
        completionHandler()
    }

Error Logging

Enable debug logging during development to view detailed SDK logs in Logcat.

 BDChatSDK.enableLogging()

API Reference

API Description
BDChatSDK.configure(“Your AppKey”, “Your brand URL”) Initializes the SDK
BDChatSDK.showChat() To open chat widget window
BDChatSDK.closeChat() To close chat widget window
BDChatSDK.setPreferredTheme(mode) Sets light/dark/system theme
BDChatSDK.customFontName = “Inter” or “Roboto” Apply custom font to match your app
BDChatSDK.enablePushNotification(fcmToken: token) To send registered device token to SDK app for receiving push notifications
BDChatSDK.disablePushNotification() To stop receiving push notifications

Limitation

Single SDK Instance:

Only one instance of the Chat SDK can run at a time. Initializing multiple instances simultaneously is not supported and may lead to unexpected behavior.

Language Support:

The current version of the SDK supports only the en-US language. Additional language support will be added in future releases.

Sample App

A sample application is provided along with the SDK package to help you understand the integration flow and available features.
You can use this app to explore the SDK behavior before integrating it into your own project iOS Sample.

Frequently Asked Questions (FAQ)

Q1: What is the BoldDesk Mobile Support SDK for iOS?
BoldDesk Chat SDK, enabling seamless integration of live chat widget functionality into your applications. With this SDK, you can embed BoldDesk’s chat widget features across platforms, delivering a smooth, customizable, and engaging customer support experience.

Q2: How do I install the SDK in my iOS project?
You need to:

  • Add the SDK dependency in your Podfile:
    target ‘YourAppTarget’ do
    use_frameworks!
    pod ‘bolddesk_chat_sdk’, ‘~> {latest-version}’
    end
  • Run pod install or pod update in your terminal.

Q3: What keys should I add to Info.plist?
Add the following keys for permissions and file handling:

  • NSCameraUsageDescription
  • NSMicrophoneUsageDescription
  • NSPhotoLibraryUsageDescription

Q4: How do I initialize the SDK?
Call:

BDChatSDK.configure(
    appKey = "Your_AppKey",
    brandUrl = "yourdomain.bolddesk.com"
)

Initialize once in your application class or before using SDK features.

Q5: How do I enable push notifications?
Integrate Firebase Cloud Messaging (FCM):

  • Add Firebase dependencies in your Podfile.
  • Register your app in Firebase Console.
  • Forward the FCM token to SDK using:
BDChatSDK.enablePushNotification(fcmToken)

Q6: How do I clear current conversation in the SDK?

  • To clear the current conversation data in the chat SDK.
BDChatSDK.clearSession()

Q7: Does the SDK support multiple instances or languages?

  • Multiple instances: No, only one SDK instance can run at a time.
  • Languages: Currently supports only en-US. More languages will be added in future releases.
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied