Inherits from NSObject
Declared in WLAnalytics.h

Overview

Contains WLAnalytics methods that manage analytics logs.

Instance Methods

addDeviceEventListener:

This method adds a DeviceEvent for Analytics to collect

- (void)addDeviceEventListener:(DeviceEvent)deviceEvent

Parameters

deviceEvent

the DeviceEvent to collect

Declared In

WLAnalytics.h

disable

This method disables capturing of analytics log data

- (void)disable

Availability

IBM Worklight V6.2.0

Declared In

WLAnalytics.h

enable

This method enables capturing of analytics log data

- (void)enable

Availability

IBM Worklight V6.2.0

Declared In

WLAnalytics.h

log:withMetadata:

This method logs analytics data Some data is already captured by the framework. To avoid collisions, the following keys will be excluded if logged in the metadata: appID appLabel appVersion appVersionCode appName appVersion deviceBrand deviceOSversion deviceOS deviceModel deviceID timezone timestamp

- (void)log:(NSString *)message withMetadata:(NSDictionary *)metadata

Parameters

metadata

Dictionary containing metadata to append to the log output

String

message to be logged

Availability

Worklight V6.2.0

Declared In

WLAnalytics.h

removeDeviceEventListener:

Disable analytics from collecting the specified DeviceEvent

- (void)removeDeviceEventListener:(DeviceEvent)deviceEvent

Parameters

deviceEvent

the DeviceEvent to remove

Declared In

WLAnalytics.h

send

This method sends the log file when the log buffer exists and is not empty.

- (void)send

Availability

IBM Worklight V6.2.0

Declared In

WLAnalytics.h

sendWithDelegate:

This method is the same as send, with the addition of a delegate that is notified when the send request succeeds or fails.

- (void)sendWithDelegate:(id<WLDelegate>)userSendAnalyticsDelegate

Parameters

userSendAnalyticsDelegate

WLDelegate that handles the result of the send request with the onSuccess and onFailure methods.

Availability

IBM MobileFirst Platform V7.0.0

See Also

Declared In

WLAnalytics.h

setUserContext:

Specify current application user. If you want user-based analytics, you must use this method call. For example, use it when the user logs in, and call the unsetUserContext method when the user logs out. Or if your application supports user profiles, call this method when the user profile changes.

- (void)setUserContext:(NSString *)user

Parameters

user

the user name of the current user.

Declared In

WLAnalytics.h

triggerFeedbackMode

Method Triggers Inapp Feedback mode

- (void)triggerFeedbackMode

Discussion

This method Works only if its specific to Bluemix instance Triggers In app Feedback Mode and enabled the user to send the feedback to Bluemix Analytic console.

This function will be invoked only if the cache preferences are set with ANALYTICS_URL_KEY and ANALYTICS_API_KEY. These properties are set only when the Mobile foundation instance belongs to Bluemix instance.

Also this function will be invoked only if analytics module installed. i.e add following as pod dependency pod ‘IBMMobileFirstPlatformFoundationAnalytics’

Declared In

WLAnalytics.h

unsetUserContext

Unset any user context previously set. Use this when user explicitly logs out or is no longer active.

- (void)unsetUserContext

Declared In

WLAnalytics.h