AppsfireEngageSDK Class Reference

Inherits from NSObject
Declared in AppsfireEngageSDK.h

Overview

Engage SDK top-level class.

Library Life

+ setDelegate:

Sets delegate when Appsfire Engage SDK calls one.

+ (void)setDelegate:(id<AppsfireEngageSDKDelegate>)delegate

Parameters

delegate

A pointer on the object that will receive the calls.

Availability

1.1.4

Discussion

Note: Most of the time Appsfire Engage SDK will alert you for on basic events. Please refer to the documentation to take note of available methods.

Declared In

AppsfireEngageSDK.h

Push Settings

+ registerPushToken:

Register the push token for APNS (Apple Push Notification Service).

+ (void)registerPushToken:(NSData *)deviceToken

Parameters

deviceToken

The push token as an NSData object. We’ll take care of its NSString representation.

Discussion

Note: You should call this method in the “application:didRegisterForRemoteNotificationsWithDeviceToken:” method in your application delegate.

Declared In

AppsfireEngageSDK.h

+ handleBadgeCountLocally:

Handle the badge count for this app locally (only on the device and only while the app is alive).

+ (void)handleBadgeCountLocally:(BOOL)handleLocally

Parameters

handleLocally

A boolean to determine if the badge count should be handled locally.

Availability

1.0.3

Discussion

Note: Note that handleBadgeCountLocally overrides any settings established by handleBadgeCountLocallyAndRemotely, and vice versa.

Declared In

AppsfireEngageSDK.h

+ handleBadgeCountLocallyAndRemotely:

Handle the badge count for this app remotely (Appsfire Engage SDK will update the icon at all times, locally and remotely, even when app is closed).

+ (void)handleBadgeCountLocallyAndRemotely:(BOOL)handleLocallyAndRemotely

Parameters

handleLocallyAndRemotely

Boolean to determine if badge count should be handled locally and remotely.

Availability

1.0.3

Discussion

Note: Note that handleBadgeCountLocallyAndRemotely overrides any settings established by handleBadgeCountLocally.

Note: IMPORTANT: If you set this option to YES, you need to provide us with your Push Certificate.

Declared In

AppsfireEngageSDK.h

Present & Close

+ presentPanelForContent:withStyle:

Present the panel for notifications / feedback in a specific style

+ (NSError *)presentPanelForContent:(AFSDKPanelContent)content withStyle:(AFSDKPanelStyle)style

Parameters

content

The default parameter (AFSDKPanelContentDefault) displays the Notification Wall. But if you choose to only display the feedback form (AFSDKPanelContentFeedbackOnly), the Notification Wall will be hidden.

style

The panel can displayed in a modal fashion over your application (AFSDKPanelStyleDefault) or in full screen (AFSDKPanelStyleFullscreen).

Return Value

If a problem occures when trying to present the panel, an error will be returned with the appropriate information.

Availability

2.0

Discussion

Note: Use this method for an easy way to present the Notification Wall. It’ll use the window to display, and handle itself so you don’t have anything to do except for calling the presentation method.

Declared In

AppsfireEngageSDK.h

+ dismissPanel

Closes the Notification Wall and/or Feedback Form

+ (void)dismissPanel

Discussion

Note: In the case you are handling the panel with a controller, you are responsible for dismissing it yourself.

Declared In

AppsfireEngageSDK.h

+ getPanelViewControllerWithError:

Get a view controller that contains the notifications view.

+ (UIViewController *)getPanelViewControllerWithError:(NSError **)error

Parameters

error

If a problem occured when trying to get the controller, error will be filled with some information.

Return Value

Return the view controller that you can present and dismiss. If nil, then you probably need to check the error pointer.

Availability

2.0

Discussion

Note: Use this method if you prefer to wrap the notifications view in a tab bar or push it in a navigation controller.

Note: IMPORTANT: You are responsible for presenting and dismissing the controller. Any leak of this controller could lead to a dysfunction of the sdk.

Declared In

AppsfireEngageSDK.h

+ isDisplayed

Tells you if the SDK is displayed.

+ (BOOL)isDisplayed

Return Value

YES if notifications panel or feedback screen is displayed, NO if none.

Declared In

AppsfireEngageSDK.h

+ openSDKNotificationID:

Opens the SDK to a specific notification ID.

+ (void)openSDKNotificationID:(int)notificationID

Parameters

notificationID

The notification ID you would like to open. Generally this ID is sent via a push to your app.

Availability

1.1.4

Discussion

Note: Calls “SDKopenNotificationResult:” on delegate set by “setDelegate” if it exists.

Declared In

AppsfireEngageSDK.h

Options

+ setBackgroundColor:textColor:

You can customize a bit the colors used for the user interface. It’ll mainly affect the header and the footer of the panel that you present.

+ (void)setBackgroundColor:(UIColor *)backgroundColor textColor:(UIColor *)textColor

Parameters

backgroundColor

The color used for the background.

textColor

The color used for the text (over the specific background color).

Availability

2.0

Discussion

Note: You must specify both the background and text colors.

Declared In

AppsfireEngageSDK.h

+ setCustomKeysValues:

Send data to SDK in key/value pairs. Strings matching any of your [KEYS] will be replaced by the respective value you send.

+ (void)setCustomKeysValues:(NSDictionary *)keyValues

Parameters

keyValues

A dictionary containing the keys/values to replace. (See documentation for example)

Availability

2.0

Declared In

AppsfireEngageSDK.h

+ setUserEmail:isModifiable:

Set user email.

+ (BOOL)setUserEmail:(NSString *)email isModifiable:(BOOL)modifiable

Parameters

email

The user’s email

modifiable

If modifiable is set to FALSE, the user won’t be able to modify his/her email in the Feedback form.

Return Value

YES if no error was detected, NO if a problem occured (likely because email was invalid).

Availability

1.1.0

Discussion

Note: If you know your user’s email, call this function so that we avoid asking the user to enter his or her email when sending feedback.

Declared In

AppsfireEngageSDK.h

+ setShowFeedbackButton:

Allow you to display or hide feedback button.

+ (void)setShowFeedbackButton:(BOOL)show

Parameters

show

The boolean to tell if feedback button should be displayed or not. Default value is YES.

Availability

1.1.5

Declared In

AppsfireEngageSDK.h

Getters

+ numberOfPendingNotifications

Returns the number of unread notifications that require attention.

+ (NSUInteger)numberOfPendingNotifications

Return Value

Return an integer that represent the number of unread notifications. If SDK isn’t initialized, this number will be 0.

Declared In

AppsfireEngageSDK.h