public class

Support

extends Object
java.lang.Object
   ↳ com.helpshift.support.Support

Class Overview

Helpshift Support API provider class

Summary

Nested Classes
interface Support.Delegate A delegate which defines the session callbacks which are available in the SDK. 
class Support.EnableContactUs

Constants to specify the possible options for enableContactUs flag

Following are the possible values

ALWAYS - User will always be shown the Contact Us option;

NEVER - User will never be shown the Contact Us option;

AFTER_VIEWING_FAQS - User can see the Contact Us option only after he has viewed FAQ;

AFTER_MARKING_ANSWER_UNHELPFUL - User can see the Contact US option only after he has marked a question unhelpful;

 

class Support.RateAlert

Constants to describe the action taken by the user inside the Alert Dialog to Rate App. 

Constants
String CustomIssueFieldKey (Optional) A Reserved key constant to be used to add custom issue fields to the config HashMap.
String CustomMetadataKey (Optional) A Reserved key constant to be used; to add custom metadata to the config HashMap.
String TagsKey A Reserved key constant to be used with setMetadataCallback to pass String array which get interpreted at server and added as Tags for the conversation submitted.
Fields
public static final String UserAcceptedTheSolution This constant is passed in Delegate#userRepliedToConversation(String) when user taps on Yes for the resolution request
public static final String UserRejectedTheSolution This constant is passed in Delegate#userRepliedToConversation(String) when user taps on No for the resolution request
public static final String UserReviewedTheApp This constant is passed in Delegate#userRepliedToConversation(String) when clicks on a review request in the ongoing conversation
public static final String UserSentScreenShot This constant is passed in Delegate#userRepliedToConversation(String) when user sends an image in the ongoing conversation
Public Methods
void _setTheme(int themeResourceId)
static void clearBreadCrumbs()
Clears Breadcrumbs list.
static SupportFragment getConversationFragment(Activity activity, ApiConfig config)
You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show the conversations screen.
static SupportFragment getConversationFragment(Activity activity, Map<StringObject> config)
This method is deprecated. As of release 6.0.0, use getConversationFragment(Activity, ApiConfig) instead.
static SupportFragment getConversationFragment(Activity activity)
You can use this API to get an embeddable SupportFragment which can be used in your Activity to show the conversations screen.
static SupportFragment getDynamicFormFragment(Activity activity, String title, List<Flow> flowList)
This will return a Dynamic form embeddable "SupportFragment".
static SupportFragment getDynamicFormFragment(Activity activity, List<Flow> flowList, Map<StringObject> config)
This method is deprecated. As of release 6.0.0, use getDynamicFormFragment(Activity, List, ApiConfig) instead.
static SupportFragment getDynamicFormFragment(Activity activity, String title, List<Flow> flowList, ApiConfig config)
This will return a Dynamic form embeddable "SupportFragment".
static SupportFragment getDynamicFormFragment(Activity activity, List<Flow> flowList)
This will return a Dynamic form embeddable "SupportFragment".
static SupportFragment getDynamicFormFragment(Activity activity, List<Flow> flowList, ApiConfig config)
This will return a Dynamic form embeddable "SupportFragment".
static SupportFragment getFAQSectionFragment(Activity activity, String sectionPublishId)
You can use this API to get an embeddable SupportFragment which can be used in your Activity to show a FAQ section with the provided section publish id.
static SupportFragment getFAQSectionFragment(Activity activity, String sectionPublishId, Map<StringObject> config)
This method is deprecated. As of release 6.0.0, use getFAQSectionFragment(Activity, String, ApiConfig) instead.
static SupportFragment getFAQSectionFragment(Activity activity, String sectionPublishId, ApiConfig config)
You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show a FAQ section with the provided section publish id.
static SupportFragment getFAQsFragment(Activity activity)
You can use this API to get an embeddable SupportFragment which can be used in your Activity to show all FAQs.
static SupportFragment getFAQsFragment(Activity activity, Map<StringObject> config)
This method is deprecated. As of release 6.0.0, use getFAQsFragment(Activity, ApiConfig) instead.
static SupportFragment getFAQsFragment(Activity activity, ApiConfig config)
You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show all FAQs.
static Support getInstance()
Return the instance of Support API provider
static void getNotificationCount(Handler success, Handler failure)
Gets notification count asynchronously by implementing the countHandler and failHandler.
static Integer getNotificationCount()
Gets notification count synchronously.
static SupportFragment getSingleFAQFragment(Activity activity, String questionPublishId, Map<StringObject> config)
This method is deprecated. As of release 6.0.0, use getSingleFAQFragment(Activity, String, ApiConfig) instead.
static SupportFragment getSingleFAQFragment(Activity activity, String questionPublishId)
You can use this API to get an embeddable SupportFragment which can be used in your Activity to show a Single FAQ with the provide question publish id.
static SupportFragment getSingleFAQFragment(Activity activity, String questionPublishId, ApiConfig config)
You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show a Single FAQ with the provide question publish id.
static boolean isConversationActive()
An 'active' conversation is one which is in progress and allows the user to send messages.
static void leaveBreadCrumb(String breadCrumb)
Adds additonal debugging information in your code.
static void setDelegate(Support.Delegate delegate)
Set the session delegate for Support
static void setMetadataCallback(MetadataCallable metadataCallable)
Provide a method to fetch custom data.
static void setMetadataCallback(Callable f)
This method is deprecated. As of release 6.0.0, use setMetadataCallback(MetadataCallable) instead.
static void setSDKLanguage(String locale)
Set the SDK language for the given locale.
static void setUserIdentifier(String userIdentifier)
(Optional) If you already have identification for your users, you can specify that as well.
static void showAlertToRateApp(String url, AlertToRateAppListener alertToRateAppListener)
Display an alert dialog, which prompts the user to rate your app, or send feedback.
static void showConversation(Activity activity, Map<StringObject> config)
This method is deprecated. As of release 6.0.1, use showConversation(Activity, ApiConfig) instead
static void showConversation(Activity activity, ApiConfig config)
You can use this api call to provide a way for the user to send feedback or start a new conversation with you.
static void showConversation(Activity activity)
You can use this api call to provide a way for the user to send feedback or start a new conversation with you.
static void showDynamicForm(Activity activity, List<Flow> flowList)
This will show the Dynamic Form screen to facilitate Guided ticket filing.
static void showDynamicForm(Activity activity, String title, List<Flow> flowList)
This will show the Dynamic Form screen to facilitate Guided ticket filing.
static void showFAQSection(Activity activity, String sectionPublishId, Map<StringObject> config)
This method is deprecated. As of release 6.0.0, use showFAQSection(Activity, String, ApiConfig) instead
static void showFAQSection(Activity activity, String sectionPublishId, ApiConfig config)
Shows FAQ section activity with Config.
static void showFAQSection(Activity activity, String sectionPublishId)
Shows FAQ section activity.
static void showFAQs(Activity activity)
Shows faqs activity.
static void showFAQs(Activity activity, ApiConfig config)
Shows faqs activity.
static void showFAQs(Activity activity, Map<StringObject> config)
This method is deprecated. As of release 6.0.0, use showFAQs(Activity, ApiConfig) instead.
static void showSingleFAQ(Activity activity, String questionPublishId, Map<StringObject> config)
This method is deprecated. As of release 6.0.0, use showSingleFAQ(Activity, String, ApiConfig) instead.
static void showSingleFAQ(Activity activity, String questionPublishId, ApiConfig config)
Shows question activity with Config.
static void showSingleFAQ(Activity activity, String questionPublishId)
Shows question activity.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String CustomIssueFieldKey

(Optional) A Reserved key constant to be used to add custom issue fields to the config HashMap. This data is sent to the server when the user starts a new conversation.

Constant Value: "hs-custom-issue-field"

public static final String CustomMetadataKey

(Optional) A Reserved key constant to be used; to add custom metadata to the config HashMap. This metadata is sent to the server when the user starts a new conversation.

Constant Value: "hs-custom-metadata"

public static final String TagsKey

A Reserved key constant to be used with setMetadataCallback to pass String array which get interpreted at server and added as Tags for the conversation submitted.

Constant Value: "hs-tags"

Fields

public static final String UserAcceptedTheSolution

This constant is passed in Delegate#userRepliedToConversation(String) when user taps on Yes for the resolution request

public static final String UserRejectedTheSolution

This constant is passed in Delegate#userRepliedToConversation(String) when user taps on No for the resolution request

public static final String UserReviewedTheApp

This constant is passed in Delegate#userRepliedToConversation(String) when clicks on a review request in the ongoing conversation

public static final String UserSentScreenShot

This constant is passed in Delegate#userRepliedToConversation(String) when user sends an image in the ongoing conversation

Public Methods

public void _setTheme (int themeResourceId)

public static void clearBreadCrumbs ()

Clears Breadcrumbs list.

Breadcrumbs list stores upto 100 latest actions. You'll receive those in every Issue. But if for reason you want to clear previous messages (On app load, for eg), you can do that by calling following function.

 Support.clearBreadCrumbs ();

public static SupportFragment getConversationFragment (Activity activity, ApiConfig config)

You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show the conversations screen.

Parameters
activity Your activity from which you call this API.
config Additional config
Returns
  • Embeddable Conversation SupportFragment

public static SupportFragment getConversationFragment (Activity activity, Map<StringObject> config)

This method is deprecated.
As of release 6.0.0, use getConversationFragment(Activity, ApiConfig) instead.

You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show the conversations screen.

Parameters
activity Your activity from which you call this API.
config Additional config
Returns
  • Embeddable Conversation SupportFragment

public static SupportFragment getConversationFragment (Activity activity)

You can use this API to get an embeddable SupportFragment which can be used in your Activity to show the conversations screen.

Parameters
activity Your activity from which you call this API.
Returns
  • Embeddable Conversation SupportFragment

public static SupportFragment getDynamicFormFragment (Activity activity, String title, List<Flow> flowList)

This will return a Dynamic form embeddable "SupportFragment".

Parameters
activity Activity
title Displayed as the title of this fragment.
flowList Your list of flows.
Returns
  • Dynamic form embeddable SupportFragment.

public static SupportFragment getDynamicFormFragment (Activity activity, List<Flow> flowList, Map<StringObject> config)

This method is deprecated.
As of release 6.0.0, use getDynamicFormFragment(Activity, List, ApiConfig) instead.

This will return a Dynamic form embeddable "SupportFragment". When using a standalone toolbar, provide the toolbar id inside the config map as "toolbarId".

Parameters
activity Activity
flowList Your list of flows.
config Config containing toolbar id.
Returns
  • Dynamic form embeddable SupportFragment.

public static SupportFragment getDynamicFormFragment (Activity activity, String title, List<Flow> flowList, ApiConfig config)

This will return a Dynamic form embeddable "SupportFragment". When using a standalone toolbar, provide the toolbar id inside the config map as "toolbarId".

Parameters
activity Activity
title Displayed as the title of this fragment.
flowList Your list of flows.
config Config containing toolbar id.
Returns
  • Dynamic form embeddable SupportFragment.

public static SupportFragment getDynamicFormFragment (Activity activity, List<Flow> flowList)

This will return a Dynamic form embeddable "SupportFragment".

Parameters
activity Activity
flowList Your list of flows.
Returns
  • Dynamic form embeddable SupportFragment.

public static SupportFragment getDynamicFormFragment (Activity activity, List<Flow> flowList, ApiConfig config)

This will return a Dynamic form embeddable "SupportFragment". When using a standalone toolbar, provide the toolbar id inside the config map as "toolbarId".

Parameters
activity Activity
flowList Your list of flows.
config Config containing toolbar id.
Returns
  • Dynamic form embeddable SupportFragment.

public static SupportFragment getFAQSectionFragment (Activity activity, String sectionPublishId)

You can use this API to get an embeddable SupportFragment which can be used in your Activity to show a FAQ section with the provided section publish id.

Parameters
activity Your activity from which you call this API.
sectionPublishId Id specifying a section.
Returns
  • Embeddable single FAQ section SupportFragment

public static SupportFragment getFAQSectionFragment (Activity activity, String sectionPublishId, Map<StringObject> config)

This method is deprecated.
As of release 6.0.0, use getFAQSectionFragment(Activity, String, ApiConfig) instead.

You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show a FAQ section with the provided section publish id.

Parameters
activity Your activity from which you call this API.
sectionPublishId Id specifying a section.
config Additional config
Returns
  • Embeddable single FAQ section SupportFragment

public static SupportFragment getFAQSectionFragment (Activity activity, String sectionPublishId, ApiConfig config)

You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show a FAQ section with the provided section publish id.

Parameters
activity Your activity from which you call this API.
sectionPublishId Id specifying a section.
config Additional config
Returns
  • Embeddable single FAQ section SupportFragment

public static SupportFragment getFAQsFragment (Activity activity)

You can use this API to get an embeddable SupportFragment which can be used in your Activity to show all FAQs.

Parameters
activity Your activity from which you call this API.
Returns
  • Embeddable all FAQs SupportFragment

public static SupportFragment getFAQsFragment (Activity activity, Map<StringObject> config)

This method is deprecated.
As of release 6.0.0, use getFAQsFragment(Activity, ApiConfig) instead.

You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show all FAQs.

Parameters
activity Your activity from which you call this API.
config Extra config
Returns
  • Embeddable all FAQs SupportFragment

public static SupportFragment getFAQsFragment (Activity activity, ApiConfig config)

You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show all FAQs.

Parameters
activity Your activity from which you call this API.
config Extra config
Returns
  • Embeddable all FAQs SupportFragment

public static Support getInstance ()

Return the instance of Support API provider

Returns

public static void getNotificationCount (Handler success, Handler failure)

Gets notification count asynchronously by implementing the countHandler and failHandler. The notification count can be obtained from the message received though the countHandler. Example:-

 private Handler countHandler = new Handler() {
 public void handleMessage(Message msg) {
 super.handleMessage(msg);
 Bundle countData = (Bundle) msg.obj;
 Integer count = countData.getInt("value");
 Boolean cache = countData.getBoolean("cache");
 if (cache) {
 Log.d("Notification Count", "local" + count);
 } else {
 Log.d("Notification Count", "server" + count);
 }
 }
 };
 Support.getNotificationCount(countHandler, new Handler());

Parameters
success Success handler
failure Failure handler

public static Integer getNotificationCount ()

Gets notification count synchronously.

Ex:-

 Integer notifCount = Support.getNotificationCount();

public static SupportFragment getSingleFAQFragment (Activity activity, String questionPublishId, Map<StringObject> config)

This method is deprecated.
As of release 6.0.0, use getSingleFAQFragment(Activity, String, ApiConfig) instead.

You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show a Single FAQ with the provide question publish id.

Parameters
activity Your activity from which you call this API.
questionPublishId Id specifying a question.
config Additional config
Returns
  • Embeddable single FAQ SupportFragment

public static SupportFragment getSingleFAQFragment (Activity activity, String questionPublishId)

You can use this API to get an embeddable SupportFragment which can be used in your Activity to show a Single FAQ with the provide question publish id.

Parameters
activity Your activity from which you call this API.
questionPublishId Id specifying a question.
Returns
  • Embeddable single FAQ SupportFragment

public static SupportFragment getSingleFAQFragment (Activity activity, String questionPublishId, ApiConfig config)

You can use this API to get an embeddable SupportFragment with the provided config, which can be used in your Activity to show a Single FAQ with the provide question publish id.

Parameters
activity Your activity from which you call this API.
questionPublishId Id specifying a question.
config Additional config
Returns
  • Embeddable single FAQ SupportFragment

public static boolean isConversationActive ()

An 'active' conversation is one which is in progress and allows the user to send messages. You can use this api call to check whether an active conversation exists or not.

Ex:-

 boolean isConversationActive = Support.isConversationActive();

Returns
  • true if an active conversation exists, false otherwise

public static void leaveBreadCrumb (String breadCrumb)

Adds additonal debugging information in your code.

You can add additional debugging statements to your code, and see exactly what the user was doing right before they started a new conversation.

 Support.leaveBreadCrumb("Went to Preferences Screen");

Parameters
breadCrumb Action/Message to add to bread-crumbs list.

public static void setDelegate (Support.Delegate delegate)

Set the session delegate for Support

Parameters
delegate The Delegate object.

public static void setMetadataCallback (MetadataCallable metadataCallable)

Provide a method to fetch custom data.

 import com.helpshift.support.MetadataCallable;
 

String [] tags = new String [] ("hello", "world");

Support.setMetadataCallback(new MetadataCallable() { public Metadata call() { HashMap metadataMap = new HashMap<>(); metadataMap.put("foo", "bar"); metadataMap.put("baz", "qux"); return new Metadata(metadataMap, tags); } });

Parameters
metadataCallable metaDataCallable implementation to provide Metadata

public static void setMetadataCallback (Callable f)

This method is deprecated.
As of release 6.0.0, use setMetadataCallback(MetadataCallable) instead.

Provide a method to fetch custom data.

 import com.helpshift.Callable;
 

String [] tags = new String [] ("hello", "world");

HashMap k = new HashMap(); k.put ("foo", "bar"); k.put ("baz", "qux"); k.put (Support.TagsKey, tags);

Support.setMetadataCallback (new Callable (){ public HashMap call() { return k; } });

Parameters
f Callbale object with call method implemented.

public static void setSDKLanguage (String locale)

Set the SDK language for the given locale. Locale can contain two-letter lowercase ISO language codes (such as "en") as defined by ISO 639-1 and in addition contain two-letter uppercase ISO country codes (such as "US") as defined by ISO 3166-1. Language code and country code are separated by an underscore ("_"). Example - "pt_BR", "zh_CN".



Example - Setting SDK language for the given locale with only language code.

 Support.setSDKLanguage("fr");
 

Example - Setting the SDK language for the given locale with both language code and country code.

 Support.setSDKLanguage("zh_CN");
 

Parameters
locale locale contains either language code or both language code and country code.

public static void setUserIdentifier (String userIdentifier)

(Optional) If you already have identification for your users, you can specify that as well.

For example:

 Support.setUserIdentifier("user-id-100");

Parameters
userIdentifier A custom user Identifier.

public static void showAlertToRateApp (String url, AlertToRateAppListener alertToRateAppListener)

Display an alert dialog, which prompts the user to rate your app, or send feedback. The alertview is not shown if a conversation is currently running with the user or if you give a null/invalid url. Example:

 String playStoreUrl = "market://details?id=<package_name>";
 AlertToRateAppListener actionListener =  new AlertToRateAppListener() {
 @Override
 public void onAction(Support.RATE_ALERT action) {
 String msg = "";
 switch (action) {
 case CLOSE:
 msg = "Close";
 break;
 case FEEDBACK:
 msg = "Feedback";
 break;
 case SUCCESS:
 msg = "Rate app";
 break;
 case FAIL:
 msg = "Alert did not show";
 break;
 }
 Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
 }
 };
 Support.showAlertToRateApp(playStoreUrl, actionListener);

Parameters
url Android application link.
alertToRateAppListener The callback which will run onAction.

public static void showConversation (Activity activity, Map<StringObject> config)

This method is deprecated.
As of release 6.0.1, use showConversation(Activity, ApiConfig) instead

You can use this api call to provide a way for the user to send feedback or start a new conversation with you.

For Example:-

 HashMap customMetadata = new HashMap();
 customMetadata.put("usertype", "paid");
 customMetadata.put("level", "7");
 customMetadata.put("score", "12345");
 

contactUsBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { HashMap config = new HashMap (); config.put("gotoConversationAfterContactUs", true); config.put("requireEmail", true); config.put(Support.CustomMetadataKey, customMetadata); Support.showConversation(MyActivity.this, config); } });

Following flags are supported in this config -

  1. gotoConversationAfterContactUs (Default : false) If set to true. Support SDK will land on conversation activity after starting a new conversation. If set to false Support SDK will land on last activity before starting a new conversation.
  2. requireEmail (Default : false) If requireEmail flag is set to true, an e-mail address is required while starting a new conversation. Default value is false i.e. e-mail is optional.
  3. conversationPrefillText The conversationPrefillText API option will pre-fill a new conversation description, with the supplied string. This is useful where you might want your users to send you diagnostic information in the conversation description, for example if the app hits an exception, etc Applicable only in the showConversation API
  4. hideNameAndEmail (Default : false) If hideNameAndEmail flag is set to true, the Name and Email field will not be shown in the new conversation form. If the name and email are set via API, they will be sent along with the issue. Default value is false i.e Name and Email fields are shown
  5. enableFullPrivacy (Default : false) If enableFullPrivacy flag is set to true, no private data will be sent which can be used to identify a user. This helps developers ensure full COPPA compliance. Default value is false i.e all user data will be sent
  6. showSearchOnNewConversation (Default : false) If showSearchOnNewConversation flag is set to true, the user will be taken to a view which shows the search results for the conversation text that he has entered. This is to avoid tickets which are already answered in the FAQs. The user will still be able to start a new conversation with the same text. Alternatively he can go through one of the FAQs and find a solution to his query. Default value is false i.e no search after Send button is pressed

Parameters
activity The Activity from which you call showConversation.
config Extra config.

public static void showConversation (Activity activity, ApiConfig config)

You can use this api call to provide a way for the user to send feedback or start a new conversation with you.

For Example:-

 HashMap customMetadata = new HashMap();
 customMetadata.put("usertype", "paid");
 customMetadata.put("level", "7");
 customMetadata.put("score", "12345");
 String[] issueTags = new String[] {"vip", "tier3"};
 

contactUsBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { ApiConfig.Builder configBuilder = new ApiConfig.Builder() .setGotoConversationAfterContactUs(true) .setRequireEmail(true) .setHideNameAndEmail(false) .setEnableFullPrivacy(true) .setShowSearchOnNewConversation(true) .setShowConversationResolutionQuestion(true);

MetaData metaData = new MetaData(customMetaData, issueTags); configBuilder.setCustomMetadata(metaData);

ApiConfig config = configBuilder.build(); Support.showConversation(MainActivity.this, config); } });

Parameters
activity The Activity from which you call showConversation.
config Api config object.

public static void showConversation (Activity activity)

You can use this api call to provide a way for the user to send feedback or start a new conversation with you.

For Example:-

 contactUsBtn.setOnClickListener(new OnClickListener() {
 @Override
 public void onClick(View view) {
 Support.showConversation(MyActivity.this);
 }
 });
 

Parameters
activity The Activity from which you call showConversation.

public static void showDynamicForm (Activity activity, List<Flow> flowList)

This will show the Dynamic Form screen to facilitate Guided ticket filing.

Parameters
activity Activity
flowList Your list of flows.

public static void showDynamicForm (Activity activity, String title, List<Flow> flowList)

This will show the Dynamic Form screen to facilitate Guided ticket filing.

Parameters
activity Activity
title Displayed as the title of this form.
flowList Your list of flows.

public static void showFAQSection (Activity activity, String sectionPublishId, Map<StringObject> config)

This method is deprecated.
As of release 6.0.0, use showFAQSection(Activity, String, ApiConfig) instead

Shows FAQ section activity with Config.

This will show a FAQ section view with list of questions in that section. The search inside this view will be limited to the specified section. You can specify a section using publish ID of that section.

For example, this can be triggered on the onClick of showFAQSectionBtn Button

 HashMap customMetadata = new HashMap();
 customMetadata.put("usertype", "paid");
 customMetadata.put("level", "7");
 customMetadata.put("score", "12345");
 

showFAQSectionBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { HashMap config = new HashMap (); config.put("gotoConversationAfterContactUs", false); config.put("enableContactUs", Support.ENABLE_CONTACT_US.NEVER); config.put("requireEmail", true); config.put(Support.CustomMetadataKey, customMetadata); Support.showFAQSection(MyActivity.this, "1", config); } });

Following flags are supported in this config -

  1. gotoConversationAfterContactUs (Default : false) If set to true. Support SDK will land on conversation activity after starting a new conversation. If set to false Support SDK will land on last activity before starting a new conversation.
  2. enableContactUs (Default : Support.ENABLE_CONTACT_US.ALWAYS) The enableContactUs flag will determine whether the Contact Us button is shown. The default value is Support.ENABLE_CONTACT_US.ALWAYS.
  3. requireEmail (Default : false) If requireEmail flag is set to true, an e-mail address is required while starting a new conversation. Default value is false i.e. e-mail is optional.
  4. hideNameAndEmail (Default : false) If hideNameAndEmail flag is set to true, the Name and Email field will not be shown in the new conversation form. If the name and email are set via API, they will be sent along with the issue. Default value is false i.e Name and Email fields are shown
  5. enableFullPrivacy (Default : false) If enableFullPrivacy flag is set to true, no private data will be sent which can be used to identify a user. This helps developers ensure full COPPA compliance. Default value is false i.e all user data will be sent
  6. showSearchOnNewConversation (Default : false) If showSearchOnNewConversation flag is set to true, the user will be taken to a view which shows the search results for the conversation text that he has entered. This is to avoid tickets which are already answered in the FAQs. The user will still be able to start a new conversation with the same text. Alternatively he can go through one of the FAQs and find a solution to his query. This flag will be ignored if the user has conducted any search or if user is filing the issue from Question screen Default value is false i.e no search after Send button is pressed
  7. customContactUsFlows This configuration allows you to override the Contact Us buttons inside the Helpshift SDK and show Guided Ticket Filing when a user taps on the Contact Us buttons. The value for this config option is list of flows. Flows can be created by using the Guided Ticket Filing APIs.

Parameters
activity The Activity from which you show section activity.
sectionPublishId Id specifying a section.
config Additional config.

public static void showFAQSection (Activity activity, String sectionPublishId, ApiConfig config)

Shows FAQ section activity with Config.

This will show a FAQ section view with list of questions in that section. The search inside this view will be limited to the specified section. You can specify a section using publish ID of that section.

For example, this can be triggered on the onClick of showFAQSectionBtn Button

 HashMap customMetaData = new HashMap<>();
 customMetaData.put("userType", "paid");
 customMetaData.put("level", 7);
 customMetaData.put("score", 12345);
 String[] issueTags = new String[] {"vip", "tier3"};
 

showFAQSectionBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { ApiConfig.Builder configBuilder = new ApiConfig.Builder() .setGotoConversationAfterContactUs(true) .setRequireEmail(true) .setHideNameAndEmail(false) .setEnableFullPrivacy(true) .setShowSearchOnNewConversation(true) .setShowConversationResolutionQuestion(true);

MetaData metaData = new MetaData(customMetaData, issueTags); configBuilder.setCustomMetadata(metaData);

ApiConfig config = configBuilder.build(); Support.showFAQSection(MainActivity.this, "1", config); } });

Parameters
activity The Activity from which you show section activity.
sectionPublishId Id specifying a section.
config Additional config.

public static void showFAQSection (Activity activity, String sectionPublishId)

Shows FAQ section activity.

This will show a FAQ section view with list of questions in that section. The search inside this view will be limited to the specified section. You can specify a section using publish ID of that section.

For example, this can be triggered on the onClick of showFAQSectionBtn Button

 showFAQSectionBtn.setOnClickListener(new OnClickListener() {
 @Override
 public void onClick(View view) {
 Support.showFAQSection(MyActivity.this, "1");
 }
 });
 

Parameters
activity The Activity from which you show section activity.
sectionPublishId Id specifying a section.

public static void showFAQs (Activity activity)

Shows faqs activity. This will show list of sections with search.

 showFaqsBtn.setOnClickListener(new OnClickListener() {
 @Override
 public void onClick(View view) {
 Support.showFAQs(MyActivity.this);
 }
 });
 

Parameters
activity The Activity from which you call show faqs activity.

public static void showFAQs (Activity activity, ApiConfig config)

Shows faqs activity. This will show list of sections with search.

 HashMap customMetaData = new HashMap<>();
 customMetaData.put("userType", "paid");
 customMetaData.put("level", 7);
 customMetaData.put("score", 12345);
 String[] issueTags = new String[] {"vip", "tier3"};
 

showFaqsBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { ApiConfig.Builder configBuilder = new ApiConfig.Builder() .setGotoConversationAfterContactUs(true) .setRequireEmail(true) .setHideNameAndEmail(false) .setEnableFullPrivacy(true) .setShowSearchOnNewConversation(true) .setShowConversationResolutionQuestion(true);

MetaData metaData = new MetaData(customMetaData, issueTags); configBuilder.setCustomMetadata(metaData);

ApiConfig config = configBuilder.build(); Support.showFAQs(MainActivity.this, config); } });

Parameters
activity The Activity from which you call show faqs activity.
config Extra config.

public static void showFAQs (Activity activity, Map<StringObject> config)

This method is deprecated.
As of release 6.0.0, use showFAQs(Activity, ApiConfig) instead.

Shows faqs activity. This will show list of sections with search.

 HashMap customMetadata = new HashMap();
 customMetadata.put("usertype", "paid");
 customMetadata.put("level", "7");
 customMetadata.put("score", "12345");
 

showFaqsBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { HashMap config = new HashMap (); config.put("gotoConversationAfterContactUs", true); config.put("enableContactUs", Support.ENABLE_CONTACT_US.ALWAYS); config.put("requireEmail", true); config.put(Support.CustomMetadataKey, customMetadata); Support.showFAQs(MyActivity.this, config); } });

Following flags are supported in this config -

  1. gotoConversationAfterContactUs (Default : false) If set to true. Support SDK will land on conversation activity after starting a new conversation. If set to false Support SDK will land on last activity before starting a new conversation.
  2. enableContactUs (Default : Support.ENABLE_CONTACT_US.ALWAYS) The enableContactUs flag will determine whether the Contact Us button is shown. The default value is Support.ENABLE_CONTACT_US.ALWAYS.
  3. requireEmail (Default : false) If requireEmail flag is set to true, an e-mail address is required while starting a new conversation. Default value is false i.e. e-mail is optional.
  4. hideNameAndEmail (Default : false) If hideNameAndEmail flag is set to true, the Name and Email field will not be shown in the new conversation form. If the name and email are set via API, they will be sent along with the issue. Default value is false i.e Name and Email fields are shown
  5. enableFullPrivacy (Default : false) If enableFullPrivacy flag is set to true, no private data will be sent which can be used to identify a user. This helps developers ensure full COPPA compliance. Default value is false i.e all user data will be sent
  6. showSearchOnNewConversation (Default : false) If showSearchOnNewConversation flag is set to true, the user will be taken to a view which shows the search results for the conversation text that he has entered. This is to avoid tickets which are already answered in the FAQs. The user will still be able to start a new conversation with the same text. Alternatively he can go through one of the FAQs and find a solution to his query. This flag will be ignored if the user has conducted any search or if user is filing the issue from Question screen Default value is false i.e no search after Send button is pressed
  7. customContactUsFlows This configuration allows you to override the Contact Us buttons inside the Helpshift SDK and show Guided Ticket Filing when a user taps on the Contact Us buttons. The value for this config option is list of flows. Flows can be created by using the Guided Ticket Filing APIs.

Parameters
activity The Activity from which you call show faqs activity.
config Extra config.

public static void showSingleFAQ (Activity activity, String questionPublishId, Map<StringObject> config)

This method is deprecated.
As of release 6.0.0, use showSingleFAQ(Activity, String, ApiConfig) instead.

Shows question activity with Config.

This provides show question view provided a publish id of that section. For example, this can be triggered on the onClick of showSingleFAQBtn Button.

 HashMap customMetadata = new HashMap();
 customMetadata.put("usertype", "paid");
 customMetadata.put("level", "7");
 customMetadata.put("score", "12345");
 

showSingleFAQBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { HashMap config = new HashMap (); config.put("gotoConversationAfterContactUs", false); config.put("enableContactUs", Support.ENABLE_CONTACT_US.NEVER); config.put("requireEmail", true); config.put(Support.CustomMetadataKey, customMetadata); Support.showSingleFAQ(MyActivity.this, "1", config); } });

Following flags are supported in this config -

  1. gotoConversationAfterContactUs (Default : false) If set to true. Support SDK will land on conversation activity after starting a new conversation. If set to false Support SDK will land on last activity before starting a new conversation.
  2. enableContactUs (Default : Support.ENABLE_CONTACT_US.ALWAYS) The enableContactUs flag will determine whether the Contact Us button is shown. The default value is Support.ENABLE_CONTACT_US.ALWAYS.
  3. requireEmail (Default : false) If requireEmail flag is set to true, an e-mail address is required while starting a new conversation. Default value is false i.e. e-mail is optional.
  4. hideNameAndEmail (Default : false) If hideNameAndEmail flag is set to true, the Name and Email field will not be shown in the new conversation form. If the name and email are set via API, they will be sent along with the issue. Default value is false i.e Name and Email fields are shown
  5. enableFullPrivacy (Default : false) If enableFullPrivacy flag is set to true, no private data will be sent which can be used to identify a user. This helps developers ensure full COPPA compliance. Default value is false i.e all user data will be sent
  6. customContactUsFlows This configuration allows you to override the Contact Us buttons inside the Helpshift SDK and show Guided Ticket Filing when a user taps on the Contact Us buttons. The value for this config option is list of flows. Flows can be created by using the Guided Ticket Filing APIs.

Parameters
activity The Activity from which you call show question activity.
questionPublishId Id specifying a section.
config Additional config.

public static void showSingleFAQ (Activity activity, String questionPublishId, ApiConfig config)

Shows question activity with Config.

This provides show question view provided a publish id of that section. For example, this can be triggered on the onClick of showSingleFAQBtn Button.

 HashMap customMetaData = new HashMap<>();
 customMetaData.put("userType", "paid");
 customMetaData.put("level", 7);
 customMetaData.put("score", 12345);
 String[] issueTags = new String[] {"vip", "tier3"};
 

showSingleFAQBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) {

ApiConfig.Builder configBuilder = new ApiConfig.Builder() .setGotoConversationAfterContactUs(true) .setRequireEmail(true) .setHideNameAndEmail(false) .setEnableFullPrivacy(true) .setShowSearchOnNewConversation(true) .setShowConversationResolutionQuestion(true);

MetaData metaData = new MetaData(customMetaData, issueTags); configBuilder.setCustomMetadata(metaData);

ApiConfig config = configBuilder.build(); Support.showSingleFAQ(MainActivity.this, "1", config); } });

Parameters
activity The Activity from which you call show question activity.
questionPublishId Id specifying a section.
config Additional config.

public static void showSingleFAQ (Activity activity, String questionPublishId)

Shows question activity.

This provides show question view provided a publish id of that section. For example, this can be triggered on the onClick of showSingleFAQBtn Button.

 showSingleFAQBtn.setOnClickListener(new OnClickListener() {
 @Override
 public void onClick(View view) {
 Support.showSingleFAQ(MyActivity.this, "1");
 }
 });
 

Parameters
activity The Activity from which you call show question activity.
questionPublishId Id specifying a section.