Skip to main content

Helpshift Delegates

The Helpshift SDK provides delegate callbacks to help app developers track a user's activities within the help section.

Helpshift Delegate implementation

Bind the event delegate by using BindEventDelegate()

You can listen to the events fired by Helpshift. All the events are defined in HelpshiftConstants.h

Note

Events invoked before binding BindEventDelegate cannot be received again.

Events

Helpshift Session Delegates

Helpshift session started event

This event gets fired when the Helpshift session starts

  • Event name: HelpshiftEventSDKSessionStarted
  • Event data: null

Helpshift session ended event

This event gets fired when the Helpshift session ends.

  • Event name: HelpshiftEventSDKSessionEnded
  • Event data: null

Unread Message Count Event

This event gets fired when you call RequestUnreadMessageCount(FetchFromServer) API to request unread messages count.

  • Event name: HelpshiftEventReceivedUnreadMessageCount
  • Event data keys:
    • HelpshiftEventDataMessageCount (int32)
    • HelpshiftEventDataMessageCountFromCache

Conversation Status Event

This event contains information about the current ongoing conversation.

  • Event name: HelpshiftEventConversationStatus
  • Event data:
    • HelpshiftEventDataLatestIssueId (FString)
    • HelpshiftEventDataLatestIssuePublishId (FString)
    • HelpshiftEventDataIsIssueOpen (bool)

Widget Toggle Event

This event is triggered when the user opens or exits the chat screen. This event is triggered with a boolean value of "visible" key. For your reference, see the below example:

  • Event name: HelpshiftEventWidgetToggle
  • Event data: HelpshiftEventDataSDKVisible (bool)

User Click On Action Event

This event is triggered when the user clicks on the link or call action of an action card message.

  • Event Name : HelpshiftEventUserClickOnAction
  • Event data:
    • HelpshiftEventDataActionData
    • HelpshiftEventDataActionType
    • HelpshiftEventDataActionTypeCall
    • HelpshiftEventDataActionTypeLink
Key (Constant)Key (Raw)Type
HelpshiftEventUserClickOnActionuserClickOnActionFString
HelpshiftEventDataActionTypeactionTypeFString
HelpshiftEventDataActionDataactionDataFString
HelpshiftEventDataActionTypeCallcallFString
HelpshiftEventDataActionTypeLinklinkFString
Note

The key constants are available from SDK X 10.3.0 onwards. For older SDK X versions, please use the raw keys instead.

Conversation Start Event

This event triggers when the user sends the first message in a conversation. The event data object has a key, message, which includes the message string the end-user sent to start the conversation. For your reference, see the below example.

  • Event name: HelpshiftEventConversationStart
  • Event data: HelpshiftEventDataMessage (FString)

Message Add Event

This event is triggered when the user adds a message in a conversation. It might be a text message, response via bot input, or an attachment. The event data object has type and body keys, which indicates the type and body of the message added by the user. For your reference, see the below example.

  • Event name: HelpshiftEventMessageAdd
  • Event data keys:
    • HelpshiftEventDataMessageType - HelpshiftEventDataMessageTypeAttachment or HelpshiftEventDataMessageTypeText
    • HelpshiftEventDataMessageBody (FString)

Agent Message Received Event

This event is triggered when the user receives any message from an agent in a conversation. This delegate is not triggered for bot messages or messages sent via automations.

  • Event name : HelpshiftEventAgentMessageReceived

  • Event data:

    KeyKey ( Raw )TypeValue
    HelpshiftEventDataPublishIDpublishIdFStringConversation ID of the ongoing issue
    HelpshiftEventDataMessageTypetypeFStringMessage Type of the message
    HelpshiftEventDataMessageBodybodyFStringThe actual message sent by the agent or empty
    HelpshiftEventDataCreatedTimecreatedTsint32Unix epoch timestamp in ms
    HelpshiftEventDataAttachmentsattachmentsMap<FString, Object>>Attachments, if they are present
    HelpshiftEventDataURLurlFStringURL of the attachment
    HelpshiftEventDataContentTypecontentTypeFStringMIME type of the attachment
    HelpshiftEventDataFileNamefileNameFStringFile name of the attachment
    HelpshiftEventDataSizesizeint32Size of the attachment in bytes
    HelpshiftEventDataMessageTypeAppReviewRequestapp_review_requestFStringMessage type when agent request for App Review
    HelpshiftEventDataMessageTypeScreenshotRequestscreenshot_requestFStringMessage type when agent request screen shot
    HelpshiftEventDataMessageTypeTexttypeFStringMessage type of text
Note
  • For Android , this delegate is available from 10.3.0 and above versions
  • The key constants are available from SDK X 10.3.0 onwards. For older SDK X versions, please use the raw keys instead.
  • The attachments key is only present if the agent has sent attachments.
  • Since attachments sent by agents may not have the necessary MIME type or name, it is possible that HelpshiftEvent.DATA_CONTENT_TYPE is absent from the payload. For such cases, file type can be inferred from extension from file name
  • HelpshiftEventDataMessageType has following types :
    • HelpshiftEventDataMessageTypeAppReviewRequest
    • HelpshiftEventDataMessageTypeScreenshotRequest
    • HelpshiftEventDataMessageTypeText

CSAT Submit Event

This event is triggered when the user submits a CSAT rating after the conversation ends. The event data object has rating and additionalFeedback keys, which indicates the (star) rating and the additional comments provided by the user with the CSAT form. For your reference, see the below example.

  • Event name: HelpshiftEventCsatSubmit
  • Event data keys:
    • HelpshiftEventDataCsatRating (int)
    • HelpshiftEventDataAdditionalFeedback (string)

Conversation End Event

This event is triggered when the conversation ends (resolved or rejected) and it cannot be reopened.

  • Event name: HelpshiftEventConversationEnd()
  • Event Data: none

Conversation Rejected Event

This event is triggered when an agent rejects the conversation.

  • Event name: HelpshiftEventConversationRejected
  • Event data: none

Conversation Resolved Event

This event is triggered when an agent resolves the conversation.

  • Event name: HelpshiftEventConversationResolved
  • Event data: none

Conversation Reopened Event

When resolution question is enabled, the users are asked if they're satisfied with the resolution. If the user rejects it and sends a new message, then the conversation is reopened and the Conversation Reopened event is triggered.

  • Event name: HelpshiftEventConversationReopened
  • Event data: none

User Authentication Failed Event

If you have user authentication feature enabled on the Dashboard and if you pass an invalid token in the Login(userDataMap), then you will receive this event with reason string. Check here for more info

You have to use BindAuthFailureDelegate to listen to Authentication failure events.

The authentication failure reason is wrapped in an enum EHelpshiftAuthenticationFailureReason Example:

Reason type :

  • EHelpshiftAuthenticationFailureReason.REASON_INVALID_AUTH_TOKEN
  • EHelpshiftAuthenticationFailureReason.REASON_AUTH_TOKEN_NOT_PROVIDED
  • EHelpshiftAuthenticationFailureReason.UNKNOWN

User Identity System Events

When using Identity system related APIs, the related events are communicated to your app using the events mentioned in this section. Events can have associated data which gives more information on the corresponding event. All these events can be found in HelpshiftConstants.h file.

Where applicable, the max permissible limits are defined as follows -

  • Key length - Max 255 chars
  • Value length for any identity (except uid) - Max 300 chars
  • Value length for uid identity - Max 750 chars
  • Value length for CUF - Max 255 chars
  • Value length for multiline CUF - Max 100000 chars
  • Value length for user tags - Max 100 chars
  • Collection size - Max 30 entries

HelpshiftIdentityTokenInvalid

Identities JWT not in valid format

  • APIs - addUserIdentities
  • Data - nil

HelpshiftIatIsMandatory

iat key is missing in the JWT. Issued At Timestamp or “iat“ is a mandatory key in the JWT payload

  • APIs - addUserIdentities
  • Data - nil

HelpshiftIdentitiesDataInvalid

Some of the identities in the JWT payload are not valid

  • APIs - addUserIdentities
  • Data -
KeyValueRecovery
One of the passed identity keysHelpshiftKeyLengthLimitExceededEnsure key length is within permissible limit
One of the passed identity keysHelpshiftValueLengthLimitExceededEnsure value length is within permissible limit
One of the passed identity keysHelpshiftEmptyDataEnsure key or value is a valid non-empty value
One of the passed identity keysHelpshiftMetadataCountLimitExceededEnsure total number of entries in metadata dictionary for this identity is within permissible limit
One of the passed identity metadata keysHelpshiftMetadataKeyLengthLimitExceededEnsure metadata key length is within permissible limit
One of the passed identity metadata keysHelpshiftMetadataValueLengthLimitExceededEnsure metadata value length is within permissible limit
One of the passed identity metadata keysHelpshiftMetadataEmptyKeyOrValueEnsure metadata key or value is a valid non-empty value

HelpshiftIdentitiesSizeLimitExceeded

Number of identities in JWT payload is more than the permissible limit

  • APIs - addUserIdentities
  • Data - nil

HelpshiftEventAddUserIdentitiesSyncFailed

User identities failed to sync with backend

  • APIs - addUserIdentities
  • Data -
KeyValueRecovery
One of the passed identity keysHelpshiftInvalidDataNA

HelpshiftEventAppAttributesLimitExceeded / HelpshiftEventMasterAttributesLimitExceeded

Number of unsynced app or master attributes exceeds the permissible limit

  • APIs - updateAppAttributes, updateMasterAttributes
  • Data - nil

HelpshiftEventUpdateAppAttributesValidationFailed / HelpshiftEventUpdateMasterAttributesValidationFailed

Validation of individual entries inside the attributes dictionary failed

  • APIs - updateAppAttributes, updateMasterAttributes
  • Data -
KeyValueRecovery
One of the passed attribute keysHelpshiftKeyLengthLimitExceededEnsure key length is within permissible limit
One of the passed attribute keysHelpshiftValueLengthLimitExceededEnsure value length is within permissible limit
One of the passed attribute keysHelpshiftCountLimitExceededReduce the number of entries in the collection for specified key
One of the passed attribute keysHelpshiftInvalidValueTypeEnsure value is one of the supported types - String, Bool, Number, String array or a String - String dictionary

HelpshiftEventUpdateAppAttributesSyncFailed / HelpshiftEventUpdateMasterAttributesSyncFailed

Attributes failed to sync with backend

  • APIs - updateAppAttributes, updateMasterAttributes

Data -

KeyValueRecovery
One of the passed attribute keysHelpshiftInvalidDataNA

HelpshiftEventUserIdentityNotEnabled

Identity feature is not enabled for your domain

  • APIs - addUserIdentities, updateAppAttributes, updateMasterAttributes
  • Data - nil

HelpshiftEventUserSessionExpired

Sent when the SDK's user session expires. Once the session expires, SDK will keep sending this event to your app on each foreground. In response to this event, you should refresh the JWT for the current user and log them in again with the new JWT.

  • Data - nil

HelpshiftEventRefreshUserCredentials

Sent when the SDK's user session is about to expire. This gives you a chance to proactively refresh the JWT for the current user and log them in the SDK with the new JWT to avoid disrupting their session.

  • Data - nil