HelpshiftCore Class Reference
Inherits from | NSObject |
---|---|
Declared in | HelpshiftCore.h |
+ enableTestingMode
Enable the testing mode for the SDK. This will give additional debug information to help you with SDK integration. DO NOT enable this in production build of your application.
+ (void)enableTestingMode
Discussion
Enable the testing mode for the SDK. This will give additional debug information to help you with SDK integration. DO NOT enable this in production build of your application.
Declared In
HelpshiftCore.h
+ initializeWithProvider:
Initialize the HelpshiftCore class with an instance of the Helpshift service which you want to use.
+ (void)initializeWithProvider:(id<HsApiProvider>)apiProvider
Parameters
apiProvider |
An implementation of the HsApiProvider protocol. Current implementors of this service are the HelpshiftCampaigns, HelpshiftSupport and HelpshiftAll classes. |
---|
Discussion
Initialize the HelpshiftCore class with an instance of the Helpshift service which you want to use.
Declared In
HelpshiftCore.h
+ installForApiKey:domainName:appID:
Initialize helpshift support
+ (void)installForApiKey:(NSString *)apiKey domainName:(NSString *)domainName appID:(NSString *)appID
Parameters
apiKey |
This is your developer API Key |
---|---|
domainName |
This is your domain name without any http:// or forward slashes |
appID |
This is the unique ID assigned to your app |
Availability
Available in SDK version 5.0.0 or later
Discussion
Initialize helpshift support
When initializing Helpshift you must pass these three tokens. You initialize Helpshift by adding the following lines in the implementation file for your app delegate, ideally at the top of application:didFinishLaunchingWithOptions. This method can throw the InstallException asynchronously if the install keys are not in the correct format.
Declared In
HelpshiftCore.h
+ installForApiKey:domainName:appID:withOptions:
Initialize helpshift support When initializing Helpshift you must pass these three tokens. You initialize Helpshift by adding the following lines in the implementation file for your app delegate, ideally at the top of application:didFinishLaunchingWithOptions. This method can throw the InstallException asynchronously if the install keys are not in the correct format.
+ (void)installForApiKey:(NSString *)apiKey domainName:(NSString *)domainName appID:(NSString *)appID withOptions:(NSDictionary *)optionsDictionary
Parameters
apiKey |
This is your developer API Key |
---|---|
domainName |
This is your domain name without any http:// or forward slashes |
appID |
This is the unique ID assigned to your app |
optionsDictionary |
This is the dictionary which contains additional configuration options for the HelpshiftSDK. |
Availability
Available in SDK version 5.0.0 or later
Discussion
Initialize helpshift support When initializing Helpshift you must pass these three tokens. You initialize Helpshift by adding the following lines in the implementation file for your app delegate, ideally at the top of application:didFinishLaunchingWithOptions. This method can throw the InstallException asynchronously if the install keys are not in the correct format.
Declared In
HelpshiftCore.h
+ installForApiKey:domainName:appID:withConfig:
Initialize helpshift support
+ (void)installForApiKey:(NSString *)apiKey domainName:(NSString *)domainName appID:(NSString *)appID withConfig:(HelpshiftInstallConfig *)configObject
Parameters
apiKey |
This is your developer API Key |
---|---|
domainName |
This is your domain name without any http:// or forward slashes |
appID |
This is the unique ID assigned to your app |
configObject |
This is the install config object which contains additional configuration options for the HelpshiftSDK. |
Availability
Available in SDK version 5.7.0 or later
Discussion
Initialize helpshift support
When initializing Helpshift you must pass these three tokens. You initialize Helpshift by adding the following lines in the implementation file for your app delegate, ideally at the top of application:didFinishLaunchingWithOptions
Declared In
HelpshiftCore.h
+ loginWithIdentifier:withName:andEmail:
Login a user with a given identifier The identifier uniquely identifies the user. Name and email are optional. (Deprecated: Deprecated in SDK version 7.0.0.)
+ (void)loginWithIdentifier:(NSString *)identifier withName:(NSString *)name andEmail:(NSString *)email
Parameters
identifier |
The unique identifier of the user. |
---|---|
name |
The name of the user. |
email |
The email of the user. |
Discussion
Login a user with a given identifier The identifier uniquely identifies the user. Name and email are optional.
Declared In
HelpshiftCore.h
+ login:
Login a user with a given identifier or email. The identifier or email uniquely identify the user. Name and authToken are optional.
+ (void)login:(HelpshiftUser *)user
Parameters
user |
The HelpshiftUser object which contains all the information about a user such as identifier, name, email, authToken. |
---|
Availability
Available in SDK version 7.0.0 or later
Discussion
Login a user with a given identifier or email. The identifier or email uniquely identify the user. Name and authToken are optional.
Declared In
HelpshiftCore.h
+ logout
Logout the currently logged in user After logout, Helpshift falls back to the default device login.
+ (void)logout
Availability
Available in SDK version 5.0.0 or later
Discussion
Logout the currently logged in user After logout, Helpshift falls back to the default device login.
Declared In
HelpshiftCore.h
+ clearAnonymousUser
Delete the anonymous user data
+ (void)clearAnonymousUser
Availability
Available in SDK version 7.0.0 or later
Discussion
Delete the anonymous user data
Declared In
HelpshiftCore.h
+ setName:andEmail:
Set the name and email of the application user. (Deprecated: Deprecated in SDK version 7.0.0.)
+ (void)setName:(NSString *)name andEmail:(NSString *)email
Parameters
name |
The name of the user. |
---|---|
email |
The email address of the user. NOTE: This API will not update the name & email provided from login API. Data from this API will be used to pre-fill name and email fields in the conversation form and also updates name and email property in campaigns. |
Availability
Available in SDK version 5.0.0 or later
Discussion
Set the name and email of the application user.
Declared In
HelpshiftCore.h
+ registerDeviceToken:
Register the deviceToken to enable push notifications To enable push notifications in the Helpshift iOS SDK, set the Push Notifications’ deviceToken using this method inside your application:didRegisterForRemoteNotificationsWithDeviceToken application delegate.
+ (void)registerDeviceToken:(NSData *)deviceToken
Parameters
deviceToken |
The deviceToken received from the push notification servers. |
---|
Availability
Available in SDK version 5.0.0 or later
Discussion
Register the deviceToken to enable push notifications To enable push notifications in the Helpshift iOS SDK, set the Push Notifications’ deviceToken using this method inside your application:didRegisterForRemoteNotificationsWithDeviceToken application delegate.
Declared In
HelpshiftCore.h
+ handleNotificationWithUserInfoDictionary:isAppLaunch:withController:
Pass along the userInfo dictionary (received with a UNNotification) for the Helpshift SDK to handle
+ (BOOL)handleNotificationWithUserInfoDictionary:(NSDictionary *)userInfo isAppLaunch:(BOOL)isAppLaunch withController:(UIViewController *)viewController
Parameters
userInfo |
dictionary contained in the UNNotification object received in App delegate. |
---|---|
isAppLaunch |
A boolean indicating whether the app was lanuched from a killed state. This parameter should ideally only be true in case when called from app’s didFinishLaunchingWithOptions delegate. |
viewController |
The viewController on which you want the Helpshift SDK stack to be shown |
Return Value
BOOL value indicating whether Helpshift handled this notification.
Availability
Available in SDK version 6.4.0 or later
Discussion
Pass along the userInfo dictionary (received with a UNNotification) for the Helpshift SDK to handle
Declared In
HelpshiftCore.h
+ handleNotificationResponseWithActionIdentifier:userInfo:completionHandler:
Pass along the notification response information for Helpshift SDK to handle
+ (BOOL)handleNotificationResponseWithActionIdentifier:(NSString *)actionIdentifier userInfo:(NSDictionary *)userInfo completionHandler:(void ( ^ ) ( void ))completionHandler
Parameters
actionIdentifier |
identifier of the action which was executed in the notification |
---|---|
userInfo |
userInfo Dictionary received (contained in the UNNotificationResponse object) |
completionHandler |
completion handler |
Return Value
BOOL value indicating whether Helpshift handled this push notification.
Availability
Available in SDK version 6.4.0 or later
Discussion
Pass along the notification response information for Helpshift SDK to handle
Declared In
HelpshiftCore.h
+ handleEventsForBackgroundURLSession:completionHandler:
If an app is woken up in the background in response to a background session being completed, call this API from the Application’s delegate method. Helpshift SDK extensively uses background NSURLSessions for data syncing.
+ (BOOL)handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void ( ^ ) ( void ))completionHandler
Parameters
identifier |
identifier of the background session |
---|---|
completionHandler |
completion handler |
Return Value
BOOL value indicating whether Helpshift handled this push notification.
Discussion
If an app is woken up in the background in response to a background session being completed, call this API from the Application’s delegate method. Helpshift SDK extensively uses background NSURLSessions for data syncing.
Declared In
HelpshiftCore.h
+ setLanguage:
Change the SDK language. By default, the device’s prefered language is used. The call will fail in the following cases : 1. If a Helpshift session is already active at the time of invocation 2. Language code is incorrect 3. Corresponding localization file is not found
+ (void)setLanguage:(NSString *)languageCode
Parameters
languageCode |
the string representing the language code. For example, use ‘fr’ for French. |
---|
Availability
Available in SDK version 6.1.0 or later
Discussion
Change the SDK language. By default, the device’s prefered language is used. The call will fail in the following cases : 1. If a Helpshift session is already active at the time of invocation 2. Language code is incorrect 3. Corresponding localization file is not found
Declared In
HelpshiftCore.h
+ setTheme:
Changes the SDK theme. Using this API will reset the behaviour of setLightTheme:darkTheme API.
+ (void)setTheme:(NSString *)themeName
Parameters
themeName |
the string representing the name of the plist file. For example, use ‘HelpshiftConfig’. |
---|
Availability
Available in SDK version 7.6.3 or later
Discussion
Changes the SDK theme. Using this API will reset the behaviour of setLightTheme:darkTheme API.
Declared In
HelpshiftCore.h
+ setLightTheme:darkTheme:
Changes the SDK theme for light and dark appearances. Using this API will reset the behaviour of setTheme API.
+ (void)setLightTheme:(NSString *)lightThemeName darkTheme:(NSString *)darkThemeName
Parameters
lightThemeName |
the string representing the name of the plist file to be set for light appearance. For example, use ‘HelpshiftConfig’. |
---|---|
darkThemeName |
the string representing the name of the plist file to be set for dark appearance. For example, use ‘HelpshiftConfigDark’. |
Availability
Available in SDK version 7.6.3 or later
Discussion
Changes the SDK theme for light and dark appearances. Using this API will reset the behaviour of setTheme API.
Declared In
HelpshiftCore.h
+ setSDKLanguage:
Change the SDK language. By default, the device’s prefered language is used. If a Helpshift session is already active at the time of invocation, this call will fail and will return false. (Deprecated: Deprecated in SDK version 6.1.0.)
+ (BOOL)setSDKLanguage:(NSString *)languageCode
Parameters
languageCode |
the string representing the language code. For example, use ‘fr’ for French. |
---|
Return Value
BOOL indicating wether the specified language was applied. In case the language code is incorrect or the corresponding localization file was not found, bool value of false is returned and the default language is used.
Availability
Available in SDK version 5.5.0 or later
Discussion
Change the SDK language. By default, the device’s prefered language is used. If a Helpshift session is already active at the time of invocation, this call will fail and will return false.
Declared In
HelpshiftCore.h
+ handleRemoteNotification:withController:
Pass along a notification to the Helpshift SDK to handle
+ (BOOL)handleRemoteNotification:(NSDictionary *)notification withController:(UIViewController *)viewController
Parameters
notification |
Notification dictionary |
---|---|
viewController |
The viewController on which you want the Helpshift SDK stack to be shown |
Return Value
BOOL value indicating whether Helpshift handled this push notification.
Discussion
Pass along a notification to the Helpshift SDK to handle
Declared In
HelpshiftCore.h
+ handleRemoteNotification:isAppLaunch:withController:
Pass along a notification to the Helpshift SDK to handle
+ (BOOL)handleRemoteNotification:(NSDictionary *)notification isAppLaunch:(BOOL)isAppLaunch withController:(UIViewController *)viewController
Parameters
notification |
Notification dictionary |
---|---|
isAppLaunch |
A boolean indicating whether the app was lanuched from a killed state. This parameter should ideally only be true in case when called from app’s didFinishLaunchingWithOptions delegate. |
viewController |
The viewController on which you want the Helpshift SDK stack to be shown |
Return Value
BOOL value indicating whether Helpshift handled this push notification.
Discussion
Pass along a notification to the Helpshift SDK to handle
Declared In
HelpshiftCore.h
+ handleLocalNotification:withController:
Pass along a local notification to the Helpshift SDK
+ (BOOL)handleLocalNotification:(UILocalNotification *)notification withController:(UIViewController *)viewController
Parameters
notification |
notification object received in the Application’s delegate method |
---|---|
viewController |
The viewController on which you want the Helpshift SDK stack to be shown |
Return Value
BOOL value indicating whether Helpshift handled this push notification.
Discussion
Pass along a local notification to the Helpshift SDK
Declared In
HelpshiftCore.h
+ handleInteractiveLocalNotification:forAction:completionHandler:
Pass along an interactive local notification to the Helpshift SDK
+ (BOOL)handleInteractiveLocalNotification:(UILocalNotification *)notification forAction:(NSString *)actionIdentifier completionHandler:(void ( ^ ) ( void ))completionHandler
Parameters
notification |
notification object received in the Application’s delegate |
---|---|
actionIdentifier |
identifier of the action which was executed in the notification |
completionHandler |
completion handler |
Return Value
BOOL value indicating whether Helpshift handled this push notification.
Discussion
Pass along an interactive local notification to the Helpshift SDK
Declared In
HelpshiftCore.h
+ handleInteractiveRemoteNotification:forAction:completionHandler:
Pass along an interactive notification to the Helpshift SDK
+ (BOOL)handleInteractiveRemoteNotification:(NSDictionary *)notification forAction:(NSString *)actionIdentifier completionHandler:(void ( ^ ) ( void ))completionHandler
Parameters
notification |
notification object received in the Application’s delegate |
---|---|
actionIdentifier |
identifier of the action which was executed in the notification |
completionHandler |
completion handler |
Return Value
BOOL value indicating whether Helpshift handled this push notification.
Discussion
Pass along an interactive notification to the Helpshift SDK
Declared In
HelpshiftCore.h
+ handleInteractiveLocalNotificationWithUserInfoDictionary:forAction:completionHandler:
Pass along an interactive local notification’s userInfo to the Helpshift SDK
+ (BOOL)handleInteractiveLocalNotificationWithUserInfoDictionary:(NSDictionary *)userInfo forAction:(NSString *)actionIdentifier completionHandler:(void ( ^ ) ( void ))completionHandler
Parameters
userInfo |
userInfo received in the notification |
---|---|
actionIdentifier |
identifier of the action which was executed in the notification |
completionHandler |
completion handler |
Return Value
BOOL value indicating whether Helpshift handled this push notification.
Discussion
Pass along an interactive local notification’s userInfo to the Helpshift SDK
Declared In
HelpshiftCore.h