Install the package
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
Required Permissions
Add the below keys in Info.plist of your app
<key>NSCameraUsageDescription</key>
<key>NSMicrophoneUsageDescription</key>
<key>NSPhotoLibraryUsageDescription</key>
SDK Initialization
Initialize once in your application class or before using SDK features.
BDSupportSDK.initialize(
appId = "YOUR_APP_ID",
brandURL = "yourdomain.bolddesk.com"
)
Authentication
Use this method to authenticate the SDK in your app after your backend generates a JWT token for the logged-in user:
Learn more on How to Authenticate Users in BoldDesk Mobile SDK.
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)
Clear Local Data
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.
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
)
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) |
Set Header Logo
You can display your brand logo in SDK headers.
BDSDKHome.setHeaderLogo("Your brand logo URL")
Custom Header Content
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
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 |
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.