-
-
Notifications
You must be signed in to change notification settings - Fork 0
u.Push Notifications
Helpshift allows you to send Push notifications when an agent replies to a conversation.
Implement FCM push in your app. To do this, implement the PushNotifications ANE for FCM.
To enable the Helpshift system to send push notifications to your users you will have to add your FCM Server API Key via the helpshift admin interface.
https://developers.helpshift.com/android/notifications/#configure-helpshift-push-admin
- Send the device registration id to Helpshift via the
registerDeviceToken()
function:
Helpshift.instance.registerDeviceToken( registrationId );
This should be done on the RegistrationEvent.REGISTER_SUCCESS
event handler:
PushNotifications.service.addEventListener( RegistrationEvent.REGISTER_SUCCESS, registrationEventHandler );
function registrationEventHandler( event:RegistrationEvent ):void
{
Helpshift.instance.registerDeviceToken( event.data );
}
- When you receive a message you must pass it to Helpshift using the
handlePush()
function:
Helpshift.instance.handlePush( payload );
This should be done when you receive the notification payload in the PushNotificationEvent.NOTIFICATION
event handler:
PushNotifications.service.addEventListener( PushNotificationEvent.NOTIFICATION, notificationHandler );
function notificationHandler( event:PushNotificationEvent ):void
{
Helpshift.instance.handlePush( event.payload );
}
By default the application icon is used as the notification icon. You can customize the notification icons using the config in the install call.
var config:HelpshiftInstallConfig = new HelpshiftInstallConfig()
.setNotificationIcon( "ic_stat_distriqt" );
Helpshift.service.install(
API_KEY,
DOMAIN,
APP_ID,
config );
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 following resources in your strings.xml file:
<string name="hs__default_notification_channel_name">Example Support Name</string>
<string name="hs__default_notification_channel_desc">Example Support Description</string>
If you want to customize the notification channels, you can create your own custom channels and provide their channel IDs using the following config APIs:
var config:HelpshiftInstallConfig = new HelpshiftInstallConfig()
.setSupportNotificationChannelId( "support_helpshift_channel" )
.setCampaignsNotificationChannelId( "campaigns_helpshift_channel" );
Helpshift.service.install(
API_KEY,
DOMAIN,
APP_ID,
config );
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.
var config:HelpshiftInstallConfig = new HelpshiftInstallConfig()
.setEnableInAppNotification( true );
Helpshift.service.install(
API_KEY,
DOMAIN,
APP_ID,
config );