This article describes how to integrate the Freshservice Support SDK (FSSupportSDK) to work with your Android mobile applications.


The FSSupportSDK helps you add the following Freshservice support features to your mobile app:

  • View Dashboard

  • View my Tickets 

  • Report an Issue

  • Request a Service

  • View Approval Requests

Requirements

The FSSupportSDK has the following requirements:

Minimum Android SDK version: 21

android:minSdkVersion="21"


The FSSupportSDK integration process involves:


  • Creating a new application

  • Adding the FSSupportSDK

  • Initializing the FSSupportSDK

  • Adding Freshservice features to your application


Creating a new application

Note: If you have an existing application, you can skip this process and proceed with adding the FSSupportSDK.


You can create a quick sample project in Android Studio, and use the project to try out the FSSupportSDK.


  1. In Android Studio, select File > New > New Project.

  2. In the New Project screen, ensure that the Phone and Tablet tab is selected. Click Empty Activity, and click Next

  3. Enter the required information in the next step, and click Finish.

    See the 
    Android developer documentation for more information.

Adding the FSSupportSDK

1. Add the maven URL to the root build.gradle (project/build.gradle). Ensure that you open the build.gradle file for the app module.


project/build.gradle


Groovy:

allprojects {
    repositories {
        mavenCentral()
    }
}


Kotlin DSL:

allprojects {
    repositories {
        mavenCentral()
    }
}


2. Add the following dependency to your app module's build.gradle file (project/app/build.gradle):


project/app/build.gradle


Groovy:

apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
  implementation 'com.freshworks.sdk:freshservicesupportsdk:{{latest-version}}'
}


Kotlin DSL:

plugins {
    id("com.android.application")
}

android {
    // ...
}

dependencies {
    // ...
    implementation("com.freshworks.sdk:freshservicesupportsdk:{{latest-version}}
")
}


Example:

implementation 'com.freshworks.sdk:freshservicesupportsdk:0.0.1-beta'


Initializing the FSSupportSDK

Before using any of the FSSupportSDK features, you must initialize the SDK in your application.

The initialization process involves setting up authentication information, configuring the theme, and other necessary setup tasks

Note: Set up the authentication flow using the following link to get the necessary authentication information (such as, domain, slug, and userToken).

Initialization in Application class

To initialize the SDK, add the following code in the onCreate() function of your Application class.

Java:

@Override
public void onCreate() {
    super.onCreate();
    FSSupport.INSTANCE.initialize(
            getApplicationContext(),// Application context
            "",  // Your Freshservice domain
            "", // Your user token
            "", // Your Freshservice slug
            null // SDK configuration
    );
}

Kotlin:

override fun onCreate() {
    super.onCreate()
    FSSupport.initialize(
        context = applicationContext, // Application context
        domain = domainName.text.toString(), // Your Freshservice domain
        userToken = "", // Your user token
        slug = "", // Your Freshservice slug
        config = null // SDK configuration
    )
}


Configuration options

  • themeColor: Use this property to apply your application’s brand color to the SDK interface. If not specified, the default will be the Freshservice theme color.

  • enableDarkMode: The SDK supports dark mode. Use this property to switch between dark and light themes. By default, the SDK will use a light theme.

Once initialized and configured, the FSSupportSDK  is ready for use within your application

Deinitialization

The SDK must be deinitialized during your application logout or any switch-user scenarios.

Java:

FSSupport.INSTANCE.deInitialize(MainActivity.this);


Kotlin:

FSSupport.deInitialize(activity = this@MainActivity)


Adding Freshservice features to your application

The FSSupportSDK provides various support-related features within your application.


Below are the support features and their corresponding methods for integration. By using these methods, the FSSupportSDK  provides easy access to essential Freshservice support features within your app.


View Dashboard

After you have integrated the FSSupportSDK with your Android mobile application, the SDK allows you to present a dashboard with specific support features you want to display in your mobile app.

The Dashboard provides access to the following support features:

  • Issues: Requesters can raise an issue with this option.

  • Service Requests: Requesters can request a service with this option.

  • Approve Requests: Requesters can view approval requests with this option.

  • Open Tickets: Requesters can view their open tickets with this option.


Use the following methods to integrate the Dashboard feature.


Java:

// Display the dashboard with specific modules
FSSupport.INSTANCE.showDashboard(
MainActivity.this, 
modules // List of supported modules
);

Kotlin:

// Display the dashboard with specific modules
FSSupport.showDashboard(
    activity = this@MainActivity, 
    modules = modules // List of supported modules
)

Supported modules

  • FSSupport.Module.TICKETS: Displays support tickets.

  • FSSupport.Module.REPORT_ISSUE: Allows users to report an issue.

  • FSSupport.Module.REQUEST_SERVICE: Allows users to request a service.

  • FSSupport.Module.APPROVAL_REQUESTS: Displays pending approval requests.


View my Tickets

The FSSupportSDK allows you to integrate the Open Tickets feature in your mobile app, which displays the list of tickets raised by a requester/user. This integration helps requesters access their open tickets directly and eliminates the need to access the Dashboard.


Use the following methods to integrate the Open Tickets feature.


Java:

FSSupport.INSTANCE.showTicketList(MainActivity.this);


Kotlin:

FSSupport.showTicketList(activity = this@MainActivity)


Raise an Issue

The FSSupportSDK allows you to integrate the Raise an Issue feature in your mobile app, which allows requesters to report a new issue or submit a support request. This integration helps requesters raise an issue directly and eliminates the need to access the Dashboard.


Use the following methods to integrate the Raise an Issue feature.


Java:

FSSupport.INSTANCE.reportIssue(MainActivity.this);


Kotlin:

FSSupport.reportIssue(activity = this@MainActivity)


Request a Service

The FSSupportSDK allows you to integrate the Request a Service feature in your mobile app, which allows requesters to initiate a service request. This integration helps requesters initiate a service request directly and eliminates the need to access the Dashboard.


Use the following methods to integrate the Request a Service feature.


Java:

FSSupport.INSTANCE.requestService(MainActivity.this);


Kotlin:

FSSupport.requestService(activity = this@MainActivity)


View Approval Requests

The FSSupportSDK allows you to integrate the View Approval Requests feature in your mobile app, which allows users to view and manage approval requests. This integration helps users manage approval requests directly and eliminates the need to access the Dashboard.


Use the following methods to integrate the View Approval Requests feature.


Java:

FSSupport.INSTANCE.showApprovalRequests(MainActivity.this);


Kotlin:

FSSupport.showApprovalRequests(activity = this@MainActivity)