java.lang.Object | |
↳ | com.helpshift.support.Support |
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 | CustomMetadataKey | (Optional) A Reserved key constant to be used; to add custom metadata to the config HashMap. | |||||||||
String | IssueTagsKey |
This constant is deprecated.
As of release 3.0.1, replaced by TagsKey
|
|||||||||
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. | |||||||||
String | UserAcceptedTheSolution | ||||||||||
String | UserRejectedTheSolution | ||||||||||
String | UserReviewedTheApp | ||||||||||
String | UserSentScreenShot |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static void |
clearBreadCrumbs()
Clears Breadcrumbs list.
| ||||||||||
static SupportFragment |
getConversationFragment(Activity activity, Map 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)
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, List<Flow> flowList)
This will return a Dynamic form embeddable "SupportFragment".
| ||||||||||
static SupportFragment |
getDynamicFormFragment(Activity activity, List<Flow> flowList, Map config)
This will return a Dynamic form embeddable "SupportFragment".
| ||||||||||
static SupportFragment |
getFAQSectionFragment(Activity activity, String sectionPublishId, Map 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 |
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 |
getFAQsFragment(Activity activity, Map 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 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 Support | getInstance() | ||||||||||
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 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 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 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(Callable f)
Provide a function to fetch custom data.
| ||||||||||
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 a, Map 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 a)
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 |
showFAQSection(Activity a, String sectionPublishId, Map config)
Shows FAQ section activity with Config.
| ||||||||||
static void |
showFAQSection(Activity a, String sectionPublishId)
Shows FAQ section activity.
| ||||||||||
static void |
showFAQs(Activity a)
Shows faqs activity.
| ||||||||||
static void |
showFAQs(Activity a, Map config)
Shows faqs activity.
| ||||||||||
static void |
showSingleFAQ(Activity a, String questionPublishId, Map config)
Shows question activity with Config.
| ||||||||||
static void |
showSingleFAQ(Activity a, String questionPublishId)
Shows question activity.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
(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.
This constant is deprecated.
As of release 3.0.1, replaced by 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.
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.
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 ();
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.
activity | Your activity from which you call this API. |
---|---|
config | Extra config |
You can use this API to get an embeddable SupportFragment which can be used in your Activity to show the conversations screen.
activity | Your activity from which you call this API. |
---|
This will return a Dynamic form embeddable "SupportFragment".
activity | Activity |
---|---|
flowList | Your list of flows. |
This will return a Dynamic form embeddable "SupportFragment". When using a standalone toolbar, provide the toolbar id inside the config map as "toolbarId".
activity | Activity |
---|---|
flowList | Your list of flows. |
config | Config containing toolbar id. |
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.
activity | Your activity from which you call this API. |
---|---|
sectionPublishId | Id specifying a section. |
config | Extra config |
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.
activity | Your activity from which you call this API. |
---|---|
sectionPublishId | Id specifying a section. |
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.
activity | Your activity from which you call this API. |
---|---|
config | Extra config |
You can use this API to get an embeddable SupportFragment which can be used in your Activity to show all FAQs.
activity | Your activity from which you call this API. |
---|
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());
success | Success handler |
---|---|
failure | Failure handler |
Gets notification count synchronously.
Ex:-Integer notifCount = Support.getNotificationCount();
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.
activity | Your activity from which you call this API. |
---|---|
questionPublishId | Id specifying a question. |
config | Extra config |
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.
activity | Your activity from which you call this API. |
---|---|
questionPublishId | Id specifying a question. |
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");
breadCrumb | Action/Message to add to bread-crumbs list. |
---|
Set the session delegate for Support
delegate | The Delegate object. |
---|
Provide a function 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; } });
f | Callbale object with call method implemented. |
---|
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");
locale | locale contains either language code or both language code and country code. |
---|
(Optional) If you already have identification for your users, you can specify that as well.
For example:Support.setUserIdentifier("user-id-100");
userIdentifier | A custom user Identifier. |
---|
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);
url | Android application link. |
---|---|
alertToRateAppListener | The callback which will run onAction. |
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 -
a | The Activity from which you call showConversation. |
---|---|
config | Extra 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:-contactUsBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { Support.showConversation(MyActivity.this); } });
a | The Activity from which you call showConversation. |
---|
This will show the Dynamic Form screen to facilitate Guided ticket filing.
activity | Activity |
---|---|
flowList | Your list of flows. |
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 ButtonHashMap 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 -
a | The Activity from which you show section activity. |
---|---|
sectionPublishId | Id specifying a section. |
config | Additional config. |
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 ButtonshowFAQSectionBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { Support.showFAQSection(MyActivity.this, "1"); } });
a | The Activity from which you show section activity. |
---|---|
sectionPublishId | Id specifying a section. |
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); } });
a | The Activity from which you call show faqs activity. |
---|
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 -
a | The Activity from which you call show faqs activity. |
---|---|
config | Extra 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"); 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 -
a | The Activity from which you call show question activity. |
---|---|
questionPublishId | Id specifying a section. |
config | Additional config. |
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"); } });
a | The Activity from which you call show question activity. |
---|---|
questionPublishId | Id specifying a section. |