Notifications
Configure Push notifications
- All the public APIs in the SDK should be called after initializing the SDK via Helpshift.install() API.
- From Android 13, notification permission is supposed to be asked by client app.
Push notifications via Helpshift
Helpshift allows you to send Push notifications when an agent replies to a conversation.
Prerequisites
Implement FCM push in your app.
For FCM, refer to the Firebase Cloud Messaging documentation.
Configure Helpshift Agent Dashboard
To enable the Helpshift system to send push notifications to your users you will have to add an Android as a platform in your app (if you have not added already).
Click on configure button and then click on the push notifications option.
Enter your FCM key credentials per app, via the Settings page > App listing in the left navigation > Scroll down to Push Notifications settings section for the app.
For FCM users, the Auth key file can be found at your Firebase API Console. For more information, click here.
Configure SDK
- Send the device registration id to Helpshift via the
Helpshift.registerDeviceTokenAPI
public class MyFirebaseMessagingService extends FirebaseMessagingService {
// ...
@Override
public void onNewToken(String newToken) {
// your logic to save the token here for the app
Helpshift.registerPushToken(newToken);
}
}
- Using FCM's new
FirebaseMessagingServicewhich provides "RemoteMessage" argument, you should useHelpshift.handlePushAPI which takes a Map argument.
@Override
public void onMessageReceived(RemoteMessage message) {
Map<String, String> data = message.getData();
String origin = data.get("origin");
if (origin != null && origin.equals("helpshift")) {
Helpshift.handlePush(data);
}
}
Rich support push notifications
Rich support push notifications give users the context of the conversation directly in the notification. A rich support notification can:
- Show the sender's name and avatar with each message.
- Show the agent's full message, even if it is long.
- Show unread messages from the conversation, so that users can catch up before opening the chat.
- Preview an image attachment sent by the agent, and describe file attachments.
- Group all messages of an issue into a single notification.
- Rich notifications are supported from SDK 10.6.0.
- On SDK versions below 10.6.0, the SDK shows a plain text notification.
Prerequisites
- Set up push notifications via Helpshift. Rich support notifications use the same FCM setup, so no additional push configuration is needed.
- On Android 13 (API level 33) and above, your app must request the POST_NOTIFICATIONS permission. The SDK does not request this permission on behalf of your app.
Personalise the sender on the dashboard
The name and avatar on the notification come from Personalise Conversation Experience on the In-app SDK configuration page.
- Go to Settings, then navigate to the App Settings section and choose the app you want to configure.
- On the App settings page, click Configure next to In-app SDK.
- On the In-app SDK configuration page, open the Support Experience tab.
- Turn on Personalise Conversation Experience.
- Set the Default Nickname. This name is used when a personal agent or bot name is not available.
- Turn on Show avatars and set the avatars for Agents, Bots, and App. You can also show the agent's personal avatar and the bot's avatar when they are available.
- Click Save & Publish.
What the notification shows
- Android shows a single notification per issue. Each new message from an agent or bot updates that notification, which keeps the earlier messages of the conversation until the user opens the chat.
- The notification shows the sender's name and avatar.
- An image attachment is previewed in the notification. Supported formats are
.jpg,.jpeg,.png,.gif, and.heic. When a message includes more than one image, any one image is previewed. - Rich notifications support localization for all static text, including attachment descriptions and resolved-issue messages.
- Rich support notification messages increment the unread message count. To display the unread message count in your app, use the
requestUnreadMessageCountAPI. For details, refer to Showing notification count when replies are sent to the user. - Proactive Engagement push notifications are not affected by this feature.
In-app notifications
In-app notifications are similar to notifications in the notification drawer . Unlike push notifications, they appear only when you app is running.
These notifications are sent when an agent replies to a customer's issue. Your customers can go straight into the conversation screen when they tap on the notification.

If the FCM device token is registered for push notifications, then in-app notifications will be disabled. In-app notifications are disabled to avoid duplicate notifications from both push notifications and in-app notifications.
Customizing notification icons
By default the application icon is used as the notification icon. You can customize the notification icons using the config in the install call.
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Map<String, Object> configurations = new HashMap<>();
configurations.put("notificationIcon", R.drawable.notification_icon);
configurations.put("notificationLargeIcon", R.drawable.notification_large_icon);
// Install call
Helpshift.install(this,
"<PLATFORM_ID>",
"<DOMAIN>",
configurations);
}
}
Customizing notification sound
By default the default device notification sound is used for helpshift notifications. You can customize the notification sound using the config in the install call.
For example:
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Map<String, Object> configurations = new HashMap<>();
configurations.put("notificationSoundId", R.raw.notification_sound);
// Install call
Helpshift.install(this,
"<PLATFORM_ID>",
"<DOMAIN>",
configurations);
}
}
Customizing notification channels
Starting from Android Oreo, Helpshift notifications will create a default channel named In-app Support. If you want to customize the name and description for the default channel, you can do so by using the config in the install call.
Example:
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Map<String, Object> configurations = new HashMap<>();
configurations.put("notificationChannelId", "your channel name here");
// Install call
Helpshift.install(this,
"<PLATFORM_ID>",
"<DOMAIN>",
configurations);
}
}
Configuring in-app notifications
If you do not want the in-app notification support provided by the Helpshift SDK, you can set the flag to false. The default value of this flag is true i.e., in app notification will be enabled.
Flag:enableInAppNotificationValues:true/falseDefault:true
Example:
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Map<String, Object> configurations = new HashMap<>();
configurations.put("enableInAppNotification", false);
// Install call
Helpshift.install(this,
"<PLATFORM_ID>",
"<DOMAIN>",
configurations);
}
}
Showing notification count when replies are sent to the user
To fetch unread messages count from the server you can call requestUnreadMessageCount(boolean shouldFetchFromServer) API. This API will return unread messages count via delegate.
Based on the value of shouldFetchFromServer, the locally stored count will be returned if shouldFetchFromServer is false else from the server by fetching remotely when shouldFetchFromServer is true.
private void updateAppBadgeCount(){
Helpshift.requestUnreadMessageCount(false);
}
// ...
Helpshift.setHelpshiftEventsListener(new HelpshiftEventsListener() {
@Override
public void onEventOccurred(@NonNull String eventName, Map<String, Object> data) {
switch(eventName){
case HelpshiftEvent.RECEIVED_UNREAD_MESSAGE_COUNT:
int count = (int) data.get(HelpshiftEvent.DATA_MESSAGE_COUNT);
boolean fromCache = (boolean) data.get(HelpshiftEvent.DATA_MESSAGE_COUNT_FROM_CACHE);
if (fromCache) {
Log.d("Notification Count", "local" + count);
} else {
Log.d("Notification Count", "server" + count);
}
}
}
// ...
- The notification count is fetched via this API from the SDK cache and Helpshift's servers (indicated by the value of
fromCachein the example above). However, the count from Helpshift’s servers is rate limited and it returns the value only if a subsequent call is made to the API, after the reset timeout or when the user just closes the chat screen (whichever is earlier). For an active issue, the reset timeout is 1 minute and 5 minutes for inactive issues.