Install the package
Add the SDK dependency in app-level build.gradle:
dependencies {
implementation("com.bolddesk:bolddesk_support_sdk:{latest-version}")
}
You can find the latest package version here Android Package.
Required Permissions
Add the following to your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> // To download or upload attachment via SDK
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> // To receive push notification in your app
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera.any" />
<!-- Required to open camera and securely capture image via SDK -->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<!-- Define cache directories path for camera image storage -->
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="downloads" path="Download/" />
<cache-path name="images" path="." />
</paths>
SDK Initialization
Initialize once in your Application class or before using SDK features.
import com.syncfusion.bolddeskmobileSDK.BoldDeskSupportSDK
BoldDeskSupportSDK.initialize(context = context, "Your AppID", "Your brand URL")
Authentication
Use this method to authenticate 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.
BoldDeskSupportSDK.loginWithJWTToken(context, jwtToken = "Your 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 (!BoldDeskSupportSDK.isLoggedIn()) // check user logged-in or token expired
{
// Call login API to authenticate user.
BoldDeskSupportSDK.loginWithJWTToken(context, jwtToken = "Your JWT token",
success =>{
BoldDeskSupportSDK.logout(context)
});
}
else
BoldDeskSupportSDK.logout(context)
Clear Local Data
Use this to clear all user data and cached content
BoldDeskSupportSDK.clearAllLocalData(context)
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.
BoldDeskSupportSDK.showKB(context = context)
Submit Ticket Page
Opens a form for creating new support tickets.
BoldDeskSupportSDK.showCreateTicket(context = context)
Dashboard (Home)
Displays a combined dashboard view with KB and Ticket options.
BoldDeskSupportSDK.showHomeDashboard(context = context)
UI Customization
Apply Theme
You can dynamically apply themes for appbar and buttons
BoldDeskSupportSDK.applyTheme(
primaryColor = "#1976D2", // App primary color
accentColor = "#FFC107" // Button
)
Theme Modes
| Mode | Description | Code snippet |
|---|---|---|
| Light | Forces light mode | BoldDeskSupportSDK.setPreferredTheme(‘light’) |
| Dark | Forces dark mode | BoldDeskSupportSDK.setPreferredTheme(‘dark’) |
| System Default | Follow system theme | BoldDeskSupportSDK.setPreferredTheme(‘system’) |
Set Header Logo
You can display your brand logo in SDK headers
BoldDeskSDKHome.SetHeaderLogo("Your brand logo URL")
Custom Header Content
You can modify section headers and description texts for:
- Home Dashboard
- Knowledge Base
- Submit Ticket
BoldDeskSDKHome.setHomeDashboardContent(
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 your custom fonts under:
- app/src/main/res/font/
Example:
- res/font/font.inter_regular.ttf
- res/font/font.inter_medium.ttf
- res/font/font.inter_bold.ttf
Register Fonts in Code
BoldDeskSupportSDK.applyCustomFontFamily(
regular = R.font.inter_regular,
bold = R.font.inter_bold,
semiBold = R.font.inter_semibold,
medium = R.font.inter_medium,
)
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 Project
- Go to Firebase Console Add Firebase to your Android project
- Add a new Android app and register it with your Bundle Identifier
- Download the generated GoogleService.plist file
- Add the file to your project
- Add Firebase dependencies in your build.gradle
implementation(platform("com.google.firebase:firebase-bom:34.3.0"))
implementation("com.google.firebase:firebase-messaging:25.0.1")
Initialize Firebase
In your AndroidManifest.xml, add your FCM service:
<service
android:name=".NotificationService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
Forward Token to SDK
class MyFirebaseService : FirebaseMessagingService() {
override fun onNewToken(token: String) {
super.onNewToken(token)
BoldDeskSupportSDK.setFCMRegistrationToken(context, token)
}
}
Handling push notifications
To handle push notifications, include the following snippets in the onMessageReceived of FirebaseMessagingService class
override fun onMessageReceived(remoteMessage: RemoteMessage) {
if (BoldDeskSupportSDK.isFromBolddeskSDK(this, remoteMessage.getData())) {
if (!BoldDeskSupportSDK.isLoggedIn()) // check user logged-in or token expired
{
// Call login API to authenticate user.
BoldDeskSupportSDK.loginWithJWTToken(context, jwtToken = "Your JWT token",
success => {
BoldDeskSupportSDK.handlePushNotifications(this, remoteMessage.getData(), icon = "Your app icon")
});
}
else
BoldDeskSupportSDK.handlePushNotifications(this, remoteMessage.getData(), icon = "Your app icon")
}
}
Error Logging
Enable debug logging during development to view detailed SDK logs in Logcat.
BoldDeskSupportSDK.loggingEnabled = true
API Reference
| API | Description |
|---|---|
| BoldDeskSupportSDK.initialize(context, “Your AppID”, “Your brand URL”) | Initializes the SDK |
| BoldDeskSupportSDK.loginWithJWTToken(context, jwtToken = “Your JWT token”) | Authenticates user with JWT |
| BoldDeskSupportSDK.clearAllLocalData(context) | Clears all SDK data and cache |
| BoldDeskSupportSDK.ApplyTheme(primaryColor, accentColor) | Applies brand colors |
| BoldDeskSupportSDK.setThemeMode(mode) | Sets light/dark/system theme |
| BoldDeskSDKHome.SetHeaderLogo(url) | Sets custom logo |
| BoldDeskSDKHome.setHomeDashboardContent(…) | Configures section headers and descriptions |
| BoldDeskSupportSDK.applyCustomFontFamily(…) | Apply custom font to match your app |
| BoldDeskSupportSDK.showHomeDashboard(context) | To open home dashboard page |
| BoldDeskSupportSDK.showCreateTicket(context) | To open create ticket page |
| BoldDeskSupportSDK.showKB(context) | To open knowledge base page |
| BoldDeskSupportSDK.setFCMRegistrationToken(context) | To send 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 Android SDK Sample.