Helpshift Delegates

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

Helpshift Delegates implementation

You have to define a class which implements Helpshift Delegates and then pass this to Helpshift using HelpshiftSupport.SetDelegate(ISupportDelegate delegateInstance) method.

For example:

Class Implementation:

using HelpshiftApi;

public class HSDelegate: ISupportDelegate
{

    public HSDelegate()
    {

    }

    public void AuthenticationFailed(HelpshiftUser user, AuthenticationFailureReason reason)
    {
    // Your code here
    }

    public void ConversationEnded()
    {
    // Your code here
    }

    public void DidCheckIfConversationActive(bool isActive)
    {
    // Your code here
    }

    public void DidReceiveNotification(int state)
    {
    // Your code here
    }

    public void DidReceiveUnreadMessagesCount(int count)
    {
    // Your code here
    }

    public bool HandleTapOnAttachmentFile(string path)
    {
    // Your code here
    }

    public void NewConversationStarted(string text)
    {
    // Your code here
    }

    public void SessionBegan()
    {
    // Your code here
    }

    public void SessionEnded()
    {
    // Your code here
    }

    public void UserCompletedCustomerSatisfactionSurvey(int value, string feedback)
    {
    // Your code here
    }

    public void UserRepliedToConversation(string reply)
    {
    // Your code here
    }
}

Class Usage:

HSDelegate delegateObject = new HSDelegate ();
HelpshiftApi.HelpshiftSupport.SetDelegate(delegateObject);

Helpshift Session delegates

Session begin

SessionBegan

If you want to keep track of when helpshift session starts in your app, you can implement this delegate callback. The delegate will get fired every time the Helpshift session starts.

Session end

SessionEnded

If you want to keep track of when helpshift session ends in your app, you can implement this delegate callback. The delegate will get fired every time the Helpshift session ends.

Conversation delegates

New Conversation Started

NewConversationStarted

If you want to keep track of when your app users start a new conversation through Helpshift, you can implement this delegate callback . The delegate will get fired every time the user starts a new conversation. The delegate method will receive the conversation message in it's arguments.

As soon as an end user opens the conversation screen, they will see a greeting message, and the conversation is considered active.

Conversation Ended

ConversationEnded

This delegate callback can be implemented to check if an ongoing Conversation has ended. This delegate is called whenever the ongoing Conversation is resolved, rejected from the Dashboard, timed out or archived.

Conversation Active

DidCheckIfConversationActive

This delegate callback can be implemented to check if a Conversation is active when queried via HelpshiftApi.HelpshiftSupport.CheckIfConversationActive()

New message delegate

UserRepliedToConversation

If you want to keep track of when your app users send new messages to an ongoing conversation, you can implement this delegate. This delegates will get called every time a user replies to a conversation. The delegate method will receive the new message's content in it's arguments. if the message is of a special type then it will be one of the following four messages.

public static final String HSUserAcceptedTheSolution = "User accepted the solution";
public static final String HSUserRejectedTheSolution = "User rejected the solution";
public static final String HSUserSentScreenShot = "User sent a screenshot";
public static final String HSUserReviewedTheApp = "User reviewed the app";

All replies from end users to your Bots (Answer Bot, Identity Bot) are also considered as new messages added by end users.

Customer satisfaction survey delegate

UserCompletedCustomerSatisfactionSurvey

If you want to keep track of when your app user completes the customer satisfaction survey for a conversation, you can implement this delegate. This delegates will get called every time a user completes the customer satisfaction survey. The delegate method will receive the rating and the feedback in it's arguments.

Display attachment delegate

DisplayAttachmentFile

Agents can attach a wide variety of files when replying to users. Following types of file formats are currently supported:

  • Video files (3gp, m4v)
  • Audio files (mp3, mp4, aac)
  • Image files (jpg, png, gif)

After the attachment is downloaded, helpshift checks for any app which can open it. if no such app is found than we fall back to passing the file to the delegate handler in the app.

New message received count delegate

DidReceiveNotification

If you want to keep a count of all new messages received in an existing conversation, you can implement this delegate. This delegate will get called with the current unread count every time when helpshift receives a new message in an existing conversation. You can also use this delegate to keep your badge counts updated.

Unread Messages Count Delegate

DidReceiveUnreadMessagesCount

This delegate can be implemented to get the count of unread messages queried via HelpshiftApi.HelpshiftSupport.RequestUnreadMessagesCount(bool)