Helpshift Class Reference

Inherits from NSObject
Declared in Helpshift.h

Overview

This documents the APIs exposed by the Helpshift SDK. Developers can use this information to integrate Helpshift support into their apps. If you want documentation regarding how to use the various features provided by the Helpshift SDK, please visit the developer docs

+ installForApiKey:domainName:appID:

Initialise Helpshift. This invocation typically needs to happen in your application:didFinishLaunchingWithOptions: method.

+ (void)installForApiKey:(NSString *)apiKey domainName:(NSString *)domainName appID:(NSString *)appID

Parameters

apiKey

Your developer API Key.

domainName

Your domain name (without ‘http:/’ or forward slashes)

appID

Unique ID assigned to your app.

Availability

Version 4.0.0 or later

Discussion

Initialise Helpshift. This invocation typically needs to happen in your application:didFinishLaunchingWithOptions: method.

Declared In

Helpshift.h

+ installForApiKey:domainName:appID:withOptions:

Initialise Helpshift. This invocation typically needs to happen into your applications didFinishLaunchingWithOptions: method.

+ (void)installForApiKey:(NSString *)apiKey domainName:(NSString *)domainName appID:(NSString *)appID withOptions:(NSDictionary *)optionsDictionary

Parameters

apiKey

Your developer API Key.

domainName

Your domain name (without ‘http:/’ or forward slashes)

appID

Unique ID assigned to your app.

optionsDictionary

Optional dictionary containing Helpshift’s configuration options and their values. Example: @{@“enableInAppNotification”:@“no”}

Availability

Version 4.0.0 or later

Discussion

Initialise Helpshift. This invocation typically needs to happen into your applications didFinishLaunchingWithOptions: method.

Declared In

Helpshift.h

+ sharedInstance

Shared instance of Helpshift class. Use this instance to make all subsequent calls like showConversation:

+ (Helpshift *)sharedInstance

Return Value

Shared Helpshift instance object.

Availability

Version 1.0.0 or later

Discussion

Shared instance of Helpshift class. Use this instance to make all subsequent calls like showConversation:

Declared In

Helpshift.h

+ pauseDisplayOfInAppNotification:

Pause/resume the display of in-app notifications.

+ (void)pauseDisplayOfInAppNotification:(BOOL)pauseInApp

Parameters

pauseInApp

If yes, the display of in-app notification is paused. To resume, pauseInApp needs to be set to no.

Availability

Version 4.3.0 or later

Discussion

Pause/resume the display of in-app notifications.

Declared In

Helpshift.h

– setSDKLanguage:

Change the SDK language manually. By default, Helpshift picks up the device language. If there is no localisation found for the language code or if a Helpshift session is already active, this method returns false. Note: Switching between RTL and LTR languages will change the actual language used but the UI controls will not change as this requires OS support.

- (BOOL)setSDKLanguage:(NSString *)languageCode

Parameters

languageCode

The string representing the language code. (like “fr” for french)

Return Value

A bool indicating wether the language change was successful. In case the language code passed could not be associated with any localisation available this will be false. SDK will fall back to the default language in this case.

Availability

Version 4.11.0 or later

Discussion

Change the SDK language manually. By default, Helpshift picks up the device language. If there is no localisation found for the language code or if a Helpshift session is already active, this method returns false. Note: Switching between RTL and LTR languages will change the actual language used but the UI controls will not change as this requires OS support.

Declared In

Helpshift.h

– showConversation:withOptions:

Display the conversation screen.

- (void)showConversation:(UIViewController *)viewController withOptions:(NSDictionary *)optionsDictionary

Parameters

viewController

The view controller on which Helpshift’s view stack will be presented.

optionsDictionary

Helpshift configuration options relevant to this method call. Pass nil, if not applicable.

Availability

Version 4.0.0 or later

Discussion

Display the conversation screen.

Declared In

Helpshift.h

– showFAQs:withOptions:

Display the FAQs.

- (void)showFAQs:(UIViewController *)viewController withOptions:(NSDictionary *)optionsDictionary

Parameters

viewController

The view controller on which Helpshift’s view stack will be presented.

optionsDictionary

Helpshift configuration options relevant to this method call. Pass nil, if not applicable.

Availability

Version 2.0.0 or later

Discussion

Display the FAQs.

Declared In

Helpshift.h

– showFAQSection:withController:withOptions:

Display an FAQ section to the user. This view will have a close button to take user back to the app.

- (void)showFAQSection:(NSString *)faqSectionPublishID withController:(UIViewController *)viewController withOptions:(NSDictionary *)optionsDictionary

Parameters

faqSectionPublishID

The publish-id of the FAQ section.

viewController

The view controller on which Helpshift’s view stack will be presented.

optionsDictionary

Helpshift configuration options relevant to this method call. Pass nil, if not applicable.

Availability

Version 2.0.0 or later

Discussion

Display an FAQ section to the user. This view will have a close button to take user back to the app.

Declared In

Helpshift.h

– showSingleFAQ:withController:withOptions:

Display a single FAQ to the user. This view will have a close button to take user back to the app.

- (void)showSingleFAQ:(NSString *)faqPublishID withController:(UIViewController *)viewController withOptions:(NSDictionary *)optionsDictionary

Parameters

faqPublishID

The publish-id of the FAQ.

viewController

The view controller on which Helpshift’s view stack will be presented.

optionsDictionary

Helpshift configuration options relevant to this method call. Pass nil, if not applicable.

Availability

Version 4.0.0 or later

Discussion

Display a single FAQ to the user. This view will have a close button to take user back to the app.

Declared In

Helpshift.h

+ showAlertToRateAppWithURL:withCompletionBlock:

Show the App rating view alert. Note that automated reviews need to be disabled in the admin to make this call effective. Also, if there is an ongoing conversation, the review alert will not show up.

+ (void)showAlertToRateAppWithURL:(NSString *)url withCompletionBlock:(AppRatingAlertViewCompletionBlock)completionBlock

Parameters

url

The App store URL to redirect to.

completionBlock

The completion block.

Availability

Version 4.4.0 or later

Discussion

Show the App rating view alert. Note that automated reviews need to be disabled in the admin to make this call effective. Also, if there is an ongoing conversation, the review alert will not show up.

Declared In

Helpshift.h

+ setUserIdentifier:

Set an identifier for the default user. This is part of additional user configuration. The user identifier will be passed through to the admin dashboard as “User ID” under customer info.

+ (void)setUserIdentifier:(NSString *)userIdentifier

Parameters

userIdentifier

A unique string identifying the default user.

Availability

Version 1.0.0 or later

Discussion

Set an identifier for the default user. This is part of additional user configuration. The user identifier will be passed through to the admin dashboard as “User ID” under customer info.

Declared In

Helpshift.h

+ setName:andEmail:

Set the name and email of the current logged in user. If you are not using the login API, the current logged in user will the the default user. The information provided here will be used to pre populate the conversation screen. Pass nil to clear the existing values.

+ (void)setName:(NSString *)name andEmail:(NSString *)email

Parameters

name

NSString representing user’s name.

email

NSString representing user’s email.

Availability

Version 4.0.0 or later

Discussion

Set the name and email of the current logged in user. If you are not using the login API, the current logged in user will the the default user. The information provided here will be used to pre populate the conversation screen. Pass nil to clear the existing values.

Declared In

Helpshift.h

+ leaveBreadCrumb:

Add extra information about user actions. You can add details about system state or user actions which can later be used to see what was going on before an issue was reported.

+ (void)leaveBreadCrumb:(NSString *)breadCrumbString

Parameters

breadCrumbString

The string to be sent to server.

Availability

Version 1.0.0 or later

Discussion

Add extra information about user actions. You can add details about system state or user actions which can later be used to see what was going on before an issue was reported.

Declared In

Helpshift.h

+ setMetadataBlock:

A block which returns a dictionary containing the custom meta data to be attached along with new conversations If you want to attach custom data along with any new conversation, use this api to provide a block which accepts zero arguments and returns an NSDictionary containing the meta data key-value pairs. Every time an issue is reported, the SDK will call this block and attach the returned meta data dictionary along with the reported issue. Ideally this metaDataBlock should be provided before the user can file an issue.

+ (void)setMetadataBlock:(metadataBlock)metadataBlock

Parameters

metadataBlock

A block variable which accepts zero arguments and returns an NSDictionary.

Availability

Version 4.0.0 or later

Discussion

A block which returns a dictionary containing the custom meta data to be attached along with new conversations If you want to attach custom data along with any new conversation, use this api to provide a block which accepts zero arguments and returns an NSDictionary containing the meta data key-value pairs. Every time an issue is reported, the SDK will call this block and attach the returned meta data dictionary along with the reported issue. Ideally this metaDataBlock should be provided before the user can file an issue.

Declared In

Helpshift.h

– getNotificationCountFromRemote:

Get the number of unread messages for current user. This comes in two flavours depending on the value used for ‘isRemote’.

- (NSInteger)getNotificationCountFromRemote:(BOOL)isRemote

Parameters

isRemote

Should the value be returned from local data or server.

Return Value

if isRemote was false, the number of unread messages for current issue is retuned. If isRemote was true, -1 is returned.

Availability

Version 4.0.0 or later

Discussion

Get the number of unread messages for current user. This comes in two flavours depending on the value used for ‘isRemote’.

If you want to get the unread messages available locally in the SDK for the current issue, set ‘isRemote’ to false. In this case the value is immediately returned. if you want Helpshift to get the number of unread messages from the servers, set ‘isRemote’ to true. In this case the value returned is -1. A server call is made to fetch the value. When the server call is successful, the value is passed to you via the didReceiveNotificationCount: delegate. To receive this call back make sure you are registered as the delegate: [[Helpshift sharedInstance] setDelegate:self];

Declared In

Helpshift.h

– registerDeviceToken:

Use this method to register the device for push notifications. To enable push notifications from Helpshift (like when an agent replies to user’s issue), pass the deviceToken received in your application delegate’s didRegisterForRemoteNotificationsWithDeviceToken: method.

- (void)registerDeviceToken:(NSData *)deviceToken

Parameters

deviceToken

Token received from APNS.

Discussion

Use this method to register the device for push notifications. To enable push notifications from Helpshift (like when an agent replies to user’s issue), pass the deviceToken received in your application delegate’s didRegisterForRemoteNotificationsWithDeviceToken: method.

Example usage - - (void) application:(UIApplication )application didRegisterForRemoteNotificationsWithDeviceToken:(NSData )deviceToken { [[Helpshift sharedInstance] registerDeviceToken:deviceToken]; }

Declared In

Helpshift.h

– handleRemoteNotification:withController:

Pass control to Helpshift for handling a push notification. In your application delegate’s didReceiveRemoteNotification: method, check if “origin” is “helpshift”. If yes, you should call this method.

- (void)handleRemoteNotification:(NSDictionary *)notification withController:(UIViewController *)viewController

Parameters

notification

The NSDictionary object received.

viewController

The current view controller on which Helpshift’s view stack will shown.

Availability

Version 4.0.0 or later

Discussion

Pass control to Helpshift for handling a push notification. In your application delegate’s didReceiveRemoteNotification: method, check if “origin” is “helpshift”. If yes, you should call this method.

Example usage - - (void) application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo { if ([[notification.userInfo objectForKey:@“origin”] isEqualToString:@“helpshift”]) { [[Helpshift sharedInstance] handleRemoteNotification:userInfo withController:self.viewController]; } }

Declared In

Helpshift.h

– handleLocalNotification:withController:

Pass control to Helpshift for handling a local notification. In your application delegate’s didReceiveLocalNotification: method, check if “origin” is “helpshift”. If yes, you should call this method.

- (void)handleLocalNotification:(UILocalNotification *)notification withController:(UIViewController *)viewController

Parameters

notification

The UILocalNotification object received.

viewController

The current view controller on which Helpshift’s view stack will shown.

Availability

Version 2.4.0 or later

Discussion

Pass control to Helpshift for handling a local notification. In your application delegate’s didReceiveLocalNotification: method, check if “origin” is “helpshift”. If yes, you should call this method.

Example usage - - (void) application:(UIApplication )application didReceiveLocalNotification:(UILocalNotification )notification { if ([[notification.userInfo objectForKey:@“origin”] isEqualToString:@“helpshift”]) { [[Helpshift sharedInstance] handleLocalNotification:notification withController:self.viewController]; } }

Declared In

Helpshift.h

– clearBreadCrumbs

Clears the current Breadcrumbs. Breadcrumbs is a list of user’s latest 100 actions. Use the leaveBreadCrumb: method to leave a Breadcrumb.

- (void)clearBreadCrumbs

Availability

Version 2.3.0 or later

Discussion

Clears the current Breadcrumbs. Breadcrumbs is a list of user’s latest 100 actions. Use the leaveBreadCrumb: method to leave a Breadcrumb.

Declared In

Helpshift.h

– closeHelpshiftSession

Closes the Helpshift session. Ignored if a Helpshift session is not active. Helpshift’s view stack is popped and user returns to the app.

- (void)closeHelpshiftSession

Availability

Version 4.8.0 or later

Discussion

Closes the Helpshift session. Ignored if a Helpshift session is not active. Helpshift’s view stack is popped and user returns to the app.

Declared In

Helpshift.h

+ loginWithIdentifier:withName:andEmail:

Logs in a user to Helpshift. This is useful in multi-login scenarios where more than one person might use the app. Creating individual logins for each user ensures that their issues remain separate. This method will not work if a Helpshift session is already active.

+ (void)loginWithIdentifier:(NSString *)identifier withName:(NSString *)name andEmail:(NSString *)email

Parameters

identifier

A unique string to identify a user.

name

Name of the user. This will be used to pre populate the ‘name’ field on issue filing screen. (optional, please pass nil if you want to ignore)

email

Email of the user. This will be used to pre populate the ‘email’ field on issue filing screen. (optional, please pass nil if you want to ignore)

Availability

Version 4.10.0 or later

Discussion

Logs in a user to Helpshift. This is useful in multi-login scenarios where more than one person might use the app. Creating individual logins for each user ensures that their issues remain separate. This method will not work if a Helpshift session is already active.

Declared In

Helpshift.h

+ logout

Logs out the current user and falls back to default login. If the current logged is user was already the default profile, this call is ignored. This call is ignored if a Helpshift session is already active.

+ (void)logout

Availability

Version 4.10.0 or later

Discussion

Logs out the current user and falls back to default login. If the current logged is user was already the default profile, this call is ignored. This call is ignored if a Helpshift session is already active.

Declared In

Helpshift.h

+ installForAppID:domainName:apiKey:

Deprecated API call. Use installForApiKey:domainName:appID: instead.

+ (void)installForAppID:(NSString *)appID domainName:(NSString *)domainName apiKey:(NSString *)apiKey

Discussion

Warning: Deprecated API call. Use installForApiKey:domainName:appID: instead.

Declared In

Helpshift.h

+ installForAppID:domainName:apiKey:withOptions:

Deprecated API call. Use installForApiKey:domainName:appID:withOptions: instead.

+ (void)installForAppID:(NSString *)appID domainName:(NSString *)domainName apiKey:(NSString *)apiKey withOptions:(NSDictionary *)optionsDictionary

Discussion

Warning: Deprecated API call. Use installForApiKey:domainName:appID:withOptions: instead.

Declared In

Helpshift.h

– showSupport:withOptions:

Deprecated API call. Use showFAQs:withOptions: instead.

- (void)showSupport:(UIViewController *)viewController withOptions:(NSDictionary *)optionsDictionary

Discussion

Warning: Deprecated API call. Use showFAQs:withOptions: instead.

Declared In

Helpshift.h

– showSupport:

Deprecated API call. Use showFAQs:withOptions: instead.

- (void)showSupport:(UIViewController *)viewController

Discussion

Warning: Deprecated API call. Use showFAQs:withOptions: instead.

Declared In

Helpshift.h

– showFAQs:

Deprecated API call. Use showFAQs:withOptions: instead.

- (void)showFAQs:(UIViewController *)viewController

Discussion

Warning: Deprecated API call. Use showFAQs:withOptions: instead.

Declared In

Helpshift.h

– reportIssue:

Deprecated API call. Use showConversation:withOptions: instead.

- (void)reportIssue:(UIViewController *)viewController

Discussion

Warning: Deprecated API call. Use showConversation:withOptions: instead.

Declared In

Helpshift.h

– reportIssue:withOptions:

Deprecated API call. Use showConversation:withOptions: instead.

- (void)reportIssue:(UIViewController *)viewController withOptions:(NSDictionary *)optionsDictionary

Discussion

Warning: Deprecated API call. Use showConversation:withOptions: instead.

Declared In

Helpshift.h

– showFAQSection:withController:

Deprecated API call. Use showFAQSection:withController:withOptions: instead.

- (void)showFAQSection:(NSString *)faqSectionPublishID withController:(UIViewController *)viewController

Discussion

Warning: Deprecated API call. Use showFAQSection:withController:withOptions: instead.

Declared In

Helpshift.h

– showFAQ:withController:

Deprecated API call. Use showSingleFAQ:withController:withOptions: instead.

- (void)showFAQ:(NSString *)faqPublishID withController:(UIViewController *)viewController

Discussion

Warning: Deprecated API call. Use showSingleFAQ:withController:withOptions: instead.

Declared In

Helpshift.h

– showInbox:

Deprecated API call. Use showConversation:withOptions: instead.

- (void)showInbox:(UIViewController *)viewController

Discussion

Warning: Deprecated API call. Use showConversation:withOptions: instead.

Declared In

Helpshift.h

– notificationCountAsync:

Deprecated API call. Use getNotificationCountFromRemote: instead.

- (NSInteger)notificationCountAsync:(BOOL)isAsync

Discussion

Warning: Deprecated API call. Use getNotificationCountFromRemote: instead.

Declared In

Helpshift.h

– handleNotification:withController:

Deprecated API call. Use handleRemoteNotification:withController: instead.

- (void)handleNotification:(NSDictionary *)notification withController:(UIViewController *)viewController

Discussion

Warning: Deprecated API call. Use handleRemoteNotification:withController: instead.

Declared In

Helpshift.h

+ setUsername:

Deprecated API call. Use setName:andEmail: instead.

+ (void)setUsername:(NSString *)name

Discussion

Warning: Deprecated API call. Use setName:andEmail: instead.

Declared In

Helpshift.h

+ setUseremail:

Deprecated API call. Use setName:andEmail: instead.

+ (void)setUseremail:(NSString *)email

Discussion

Warning: Deprecated API call. Use setName:andEmail: instead.

Declared In

Helpshift.h