Skip to main content

Notifications Android

Configure Push notifications.

Note

If you want to configure the notifications for iOS - please refer here

Configure push notifications via Helpshift

urbanAirshipNotif.png

Helpshift enables you to send notifications to your users. This is particularly useful when you have multiple users on multiple platforms like iOS and Android. Notifications are useful to tell your users when you reply to an issue that they submitted.

To know more about the FCM Push, refer:- Firebase Cloud Messaging

Prerequisites

Implement FCM push notifications in your app.

For FCM, refer to the Firebase Cloud Messaging documentation.

You can use any Firebase plugin from Unreal Engine marketplace. For ex - Firebase Goodies

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). And then click on the push notifications option.

Enter your FCM key credentials per app, via the Settings page > Scroll down to App Settings the left pane > Select your App > Under Supported Platforms iOS/Android > Click Configure > Select Push Notification section.

For FCM users, the Auth key file can be found at your Firebase API Console. For more information, click here.

Configure the Helpshift Unreal Engine SDK to handle notifications

Push notifications

Configure FCM push notification plugins {#}

After you have configured the push notifications in the Helpshift console, you will need to add additional setup in the project, too.

First of all, you should enable the Use Push Notifications toggle in the Project Settings:

Then you will have to call the Register Push Token function once your application receives a push token from your provider:

For example with Firebase Goodies, you can call Get Instance Id Data function to fetch the push registration token. Register this token with Helpshift SDK via Register Push Token function.

To handle the incoming push notifications on Android you will have to modify the native java sources of the push notification provider listener class:

For example with Firebase Goodies, you can modify the FGMessageReceiver.java class (located at "<your_project_path>/Plugins/FirebaseGoodies/Source/FirebaseGoodies/Private/Java/FGMessageReceiver.java) to handle notifications from Helpshift as following:

To check whether this notification is being sent from the Helpshift's push notification service, please check the origin field of the notification. If it is "helpshift", the notification is a Helpshift notification.

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.

Note

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.

Showing notification count when replies are sent to the user

To fetch unread messages count from the server you can call RequestUnreadMessageCount(bool FetchFromServer); API. This API will return unread messages count via delegate. Based on the value of FetchFromServer, the locally stored count will be returned if FetchFromServer is false else from the server by fetching remotely when FetchFromServer is true. An example use of this count is to update the badge count to indicate unread messsages. Please note that before calling this method, you need to set the listener for Helpshift events by calling the BindEventDelegate(const FHelpshiftEventDelegate& Callback) API.

When you call this API, you receive the unread count in your event delegate HelpshiftEventReceivedUnreadMessageCount() Keys in event data: HelpshiftEventDataMessageCount (int), HelpshiftEventDataMessageCountFromCache (int)

  • The notification count is fetched via this API from the SDK cache and Helpshift's servers (indicated by the value of HelpshiftEventDataMessageCountFromCache in 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.