public class NexusConnectSDK
extends java.lang.Object
This class cannot be instantiated by creating its object, all the exposed methods are static methods and they return object of type NexusConnectSDKFluent
,
so that developer can call multiple methods inline(For e.g NexusConnectSDK.setFirstName(first-name).setLastName(last-name).setEmail(email-id)
);
Developer should always call API initialize(jwt)
with valid JWT token before making call to any other API from the class.
Once initialized developer can start self-help (showSelfHelpForId, showSelfHelpForTags
) and live support (showLiveHelp
) session.
API isLiveHelpActive
can be used to check the status of current running session.
Class also expose APIs to log various types of data while running support session (like logAction(), logDevice(), etc
) which helps agent
to assist the user in much better way.
To stop everything and exit from current running session call API exitHelp()
.
Note:Make sure to always pass current Activity context wherever required.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_LIVE_SESSION_CLOSED |
static java.lang.String |
SDK_VERSION
Current SDK version.
|
Modifier and Type | Method and Description |
---|---|
static void |
activityPaused(Activity activity)
Call this API to notify SDK, that your activity is going to background.
|
static void |
activityResumed(Activity activity)
Call this API to notify SDK, that your activity is coming to foreground.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
clearContext()
Use this API to clear all the previously logged data(actions, device, help-id, tags, etc)
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
clearIdentity()
Use this API to clear user info(first name, last name, email, etc)
|
static boolean |
exitHelp()
Call to this API will stop the current ongoing support session.
|
static void |
exitOnBackPress(boolean exit)
Call this API to exit support session on back button press from SDK.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
initialize(java.lang.String JWTToken)
Initialize SDK by passing valid JWT Token.
|
static boolean |
isLiveHelpActive()
Use this API to know, if a Live support session is running in background.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
log(java.lang.String type,
java.lang.String name)
Use this API to log custom application specific data.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
log(java.lang.String type,
java.lang.String name,
java.util.HashMap<java.lang.String,java.lang.String> map)
Use this API to log custom application specific data with additional fields.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
logAction(java.lang.String name)
Use this API to log user current actions.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
logAction(java.lang.String name,
java.util.HashMap<java.lang.String,java.lang.String> map)
Use this API to log user current actions with additional custom data.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
logDevice(java.lang.String name)
Use this API to log device information.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
logDevice(java.lang.String name,
java.util.HashMap<java.lang.String,java.lang.String> map)
Use this API to log device information with additional custom data.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
preserveContext(boolean preserve)
Use this API to tell SDK whether to preserve current context data after show Self-Help API call.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
removeAction(java.lang.String action)
Use this API to remove previously logged actions.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
setData(java.lang.String key,
java.lang.String value)
Use this API to pass custom data to SDK as key-value pair.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
setEmail(java.lang.String email)
Use this API to pass your email id to SDK.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
setExternalId(java.lang.String externalId)
Use this API to pass your external id to SDK.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
setFirstName(java.lang.String firstName)
Use this API to pass your first name to SDK.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
setLastName(java.lang.String lastName)
Use this API to pass your last name to SDK.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
setOrientation(int orientation)
Use this API to set device orientation.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
setPhone(java.lang.String phone)
Use this API to pass your phone number to SDK.
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
showLiveHelp(Activity activity, Object... intentData)
Use this API only if your App needs only "Live/assisted" help (without "SelfHelp")
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
showSelfHelpForId(Activity activity,
java.lang.String id,
java.lang.String[] displayOrder,
int parentLayoutId)
Use this API to show Self-help using helpId
|
static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent |
showSelfHelpForTags(Activity activity,
java.lang.String[] tags,
java.lang.String[] displayOrder,
int parentLayoutId)
Use this API to show Self-help using Tags
|
public static final java.lang.String SDK_VERSION
public static final java.lang.String ACTION_LIVE_SESSION_CLOSED
public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent initialize(java.lang.String JWTToken)
JWTToken
- An application token, which is used to authenticate and authorize your application with Support.com server.public static boolean exitHelp()
public static boolean isLiveHelpActive()
public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent showLiveHelp(Activity activity, Object... intentData)
activity
- Current activity contextintentData
- Optional parameter. Use this parameter to pass activity intent data only when you want to start live help on click of auto connect link. public static void activityResumed(Activity activity)
activity
- Current activity contextpublic static void activityPaused(Activity activity)
activity
- Current activity contextpublic static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent setFirstName(java.lang.String firstName)
firstName
- First name of user.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent setLastName(java.lang.String lastName)
lastName
- Last name of user.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent setOrientation(int orientation)
orientation
- required orientation.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent setEmail(java.lang.String email)
email
- email id of user.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent setPhone(java.lang.String phone)
phone
- Phone number of user.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent setExternalId(java.lang.String externalId)
externalId
- external id of user.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent setData(java.lang.String key, java.lang.String value)
key
- key of custom data.value
- the actual data to be passed.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent logAction(java.lang.String name)
name
- Name of the action.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent removeAction(java.lang.String action)
action
- Name of the action.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent logAction(java.lang.String name, java.util.HashMap<java.lang.String,java.lang.String> map)
name
- Name of the action.map
- Application specific custom data.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent logDevice(java.lang.String name)
name
- Name device specific data.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent logDevice(java.lang.String name, java.util.HashMap<java.lang.String,java.lang.String> map)
name
- Name device specific data.map
- Device specific data.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent log(java.lang.String type, java.lang.String name)
type
- Type of data to be logged.name
- The actual data.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent log(java.lang.String type, java.lang.String name, java.util.HashMap<java.lang.String,java.lang.String> map)
type
- Type of data to be logged.name
- The actual data.map
- Dictionary of custom key value pair.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent showSelfHelpForId(Activity activity, java.lang.String id, java.lang.String[] displayOrder, int parentLayoutId)
activity
- Calling activity context.id
- helpid of guided path.displayOrder
- Display order for search, categories, paths, contact us, etc.
Note: displayOrder can be nullparentLayoutId
- Resource id of the layout where self help will be displayed.
If passed, then the self help opens in the same layout else it opens the usual SelfSupport-LiveSupport way.
Note: Pass -1 to display SelfSupport-LiveSupport Page.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent showSelfHelpForTags(Activity activity, java.lang.String[] tags, java.lang.String[] displayOrder, int parentLayoutId)
activity
- Calling activity context.tags
- tags of guided path(s).displayOrder
- Display order for search, categories, paths, contact us, etc.parentLayoutId
- Resource id of the layout where self help will be displayed.
If passed, then the self help opens in the same layout else it opens the usual SelfSupport-LiveSupport way.public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent clearContext()
public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent clearIdentity()
public static com.sprt.android.esnuilib.initialize.NexusConnectSDKFluent preserveContext(boolean preserve)
preserve
- true if data needs to be preserved, else false.public static void exitOnBackPress(boolean exit)
exit
- true to exit support session on back button press, else false.