Articles in this section
Category / Section

How to Configure and Integrate SDK in Your iOS app

Updated:

Integrating the BoldDesk Mobile Support SDK into your iOS application enables you to provide a complete in-app support experience for your users. With this SDK, you can embed a help center that allows users to access Knowledge Base articles, submit support tickets, and receive real-time notifications—all without leaving your app.

This guide will walk you through the steps to install, configure, and customize the BoldDesk SDK for iOS, including:

  • Adding the SDK dependency using CocoaPods.
  • Initializing the SDK and authenticating users with JWT.
  • Displaying modules such as Knowledge Base, Submit Ticket, and Dashboard.
  • Customizing the UI with themes, fonts, and branding elements.
  • Setting up push notifications for ticket updates.
  • Enabling error logging and reviewing available APIs.

By following this guide, you’ll ensure a seamless, branded support experience for your iOS users while maintaining secure authentication and real-time communication.

SDK Installation

Add SDK dependency

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

target 'YourAppTarget' do
  use_frameworks!
  pod 'bolddesk_support_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 BoldDeskSupportSDK

Add the below keys in Info.plist of your app

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

Initialization and Authentication

Initialize SDK

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

BDSupportSDK.initialize(
    appId = "YOUR_APP_ID",
    brandURL = "yourdomain.bolddesk.com"
)

Authenticate User with JWT

Learn more on How to Authenticate Users in BoldDesk Mobile SDK.

Use this method to authenticate the SDK in your app after your backend generates a JWT token for the logged-in user:

BDSupportSDK.loginWithJWTToken("JWT_TOKEN")

Logout

To unauthenticate a user, call the logout API. This will remove the user’s authentication and clear their session from the SDK.

if !BDSupportSDK.isLoggedIn() // check user logged-in or token expired
{
    // Call login API to authenticate user.
    BDSupportSDK.loginWithJWTToken(jwtToken = "Your JWT token",
    { 
    success in 
         BDSupportSDK.logout(context)
    })
}
else
    BDSupportSDK.logout(context)

Reset SDK

Use this to clear all user data and cached content:

BDSupportSDK.clearAllLocalData()

Display Modules

The SDK provides independent and combined modules to integrate specific features into your app.

Displayed_KB_and_Ticket_BoldDesk_Modules_in_iOS_App_via_Mobile_SDK.png

Knowledge Base (KB)

Displays articles, categories, and search functionality.

BDSupportSDK.showKB()

Submit Ticket Page

Opens a form for creating new support tickets.

BDSupportSDK.showSubmitTicket()

Dashboard (Home)

Displays a combined dashboard view with KB and Ticket options.

BDSupportSDK.showHome()

UI Customization

Apply Theme

You can dynamically apply themes for app bar and buttons:

BDSupportSDK.applyTheme(
    primaryColor = "#1976D2",     // App primary color
    accentColor = "#FFC107"       // Buttons
)

It is not recommended to apply a theme using the same color for both primary and accent. This may affect readability and visibility of UI components.

Theme Modes

Mode Description Code snippet
Light Forces light mode BDSupportSDK.setPreferredTheme(.light)
Dark Forces dark mode BDSupportSDK.setPreferredTheme(.dark)
System Default Follows system theme BDSupportSDK.setPreferredTheme(.system)

Light_and_Dark_theme_mode_Options_for_Displayed_KB_and_Ticket_BoldDesk_Modules_in_iOS_App_via_Mobile.png

Set Custom Header Logo

You can display your brand logo in SDK headers.

BDSDKHome.setHeaderLogo("Your brand logo URL")

Custom Header Titles & Descriptions

You can modify section headers and description texts for:

  • Home Dashboard
  • Knowledge Base
  • Submit Ticket
BDSDKHome.set(
    header = "Welcome to BoldDesk Help Center",
    description = "How can we help? We're here for you!",
    kbTitle = "Knowledge Base",
    kbDescription = "Explore help articles and FAQs.",
    ticketTitle = "Submit Ticket",
    ticketDescription = "Need assistance? Create a ticket below."
)

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

BDPortalConfiguration.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?) {
        BDSupportSDK.enablePushNotification(fcmToken: fcmToken)
    }

Handling push notifications

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

  .onReceive(NotificationCenter.default.publisher(for: Notification.Name("NotificationTapped"))) { notification in
                if let data = notification.object as? [AnyHashable: Any] {
                    if BDSupportSDK.isFromBolddeskSDK(this, remoteMessage.getData()){
                        if !BDSupportSDK.isLoggedIn() // check user logged-in or token expired
                        {
                           // Call login API to authenticate user.
                             BDSupportSDK.loginWithJWTToken(jwtToken = "Your JWT token",
                               {
                                   success in
                                     BDSupportSDK.processRemoteNotification(userInfo: data)
                            })
                         }
                         else
                            BDSupportSDK.processRemoteNotification(userInfo: data)
                        }
                   }
            }
        }

Error Logging

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

 BDSupportSDK.enableLogging()

API Reference

API Description
BDSupportSDK.initialize(“Your AppID”, “Your brand URL”) Initializes the SDK
BDSupportSDK.LoginWithJWTToken(“Your JWT token”) Authenticates user with JWT
BDSupportSDK.clearAllLocalData() Clears all SDK data and cache
BDSupportSDK.applyTheme(primaryColor, accentColor) Applies brand colors
BDSupportSDK.setPreferredTheme(“light” or “dark”) Sets light/dark/system theme
BDSDKHome.SetHeaderLogo(url) Sets custom logo
BDSDKHome.set(…) Configures section headers and descriptions
BDSupportSDK.applyCustomFontFamily(…) Apply custom font to match your app
BDSupportSDK.showHome() Opens home dashboard page
BDSupportSDK.showSubmitTicket() Opens create ticket page
BDSupportSDK.showKB() Opens knowledge base page
BDSupportSDK.enablePushNotification() Sends registered device token to SDK app for receiving push notifications

Limitation

Single SDK Instance:

Only one instance of the Support 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?
The BoldDesk Mobile Support SDK allows you to embed a help center in your iOS app, enabling users to access Knowledge Base articles, submit tickets, and receive real-time notifications without leaving the app.

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_support_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:

BDSupportSDK.initialize(
    appId = "YOUR_APP_ID",
    brandURl = "yourdomain.bolddesk.com"
)

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

Q5: How do I authenticate users?
Authentication uses JWT tokens generated by your backend. After login, call:

BDSupportSDK.LoginWithJWTToken("JWT_TOKEN")

Learn more about authentication flow in the related guide.

Q6: How do I log out or reset the SDK?

  • To log out:
BDSupportSDK.logout()
  • To clear all cached data:
BDSupportSDK.clearAllLocalData()

Q7: What modules can I display in my app?
You can show:

  • Knowledge Base: BDSupportSDK.showKB()
  • Submit Ticket Page: BDSupportSDK.showSubmitTicket()
  • Dashboard (Home): BDSupportSDK.showHome()

Q8: Can I customize the SDK UI?
Yes, you can:

  • Apply themes using applyTheme().
  • Set light/dark/system theme modes.
  • Add custom header logos and modify section titles.
  • Apply custom fonts defined in your app.

Q9: 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:
BDSupportSDK.enablePushNotification(fcmToken)

Handle notifications in didReceiveRemoteNotification using:

BDSupportSDK.processRemoteNotification(userInfo: data)

Q10: 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