HelpshiftCore Class Reference

Inherits from NSObject
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 implementor of this service is HelpshiftSupport class.

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.

Declared In

HelpshiftCore.h

+ installForApiKey:domainName:appID:withOptions:

Initialize helpshift support

+ (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

withOptions

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

Declared In

HelpshiftCore.h

+ loginWithIdentifier:withName:andEmail:

Login a user with a given identifier

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

Parameters

name

The name of the user

email

The email of the user

Availability

Available in SDK version 5.0.0 or later

Discussion

Login a user with a given identifier

The identifier uniquely identifies the user. Name and email are optional.

Declared In

HelpshiftCore.h

+ logout

Logout the currently logged in user

+ (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

+ setName:andEmail:

Set the name and email of the application user.

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

Parameters

name

The name of the user.

email

The email address of the user.

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

+ (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

+ 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

+ 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

+ handleInteractiveRemoteNotification:forAction:completionHandler:

Pass along an interactive notification to the Helpshift SDK

+ (BOOL)handleInteractiveRemoteNotification:(NSDictionary *)notification forAction:(NSString *)actionIdentifier completionHandler:(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

+ handleInteractiveLocalNotification:forAction:completionHandler:

Pass along an interactive local notification to the Helpshift SDK

+ (BOOL)handleInteractiveLocalNotification:(UILocalNotification *)notification forAction:(NSString *)actionIdentifier completionHandler:(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

+ 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 ( ^ ) ( ))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