WLAnalytics Class Reference
Inherits from | NSObject |
Declared in | WLAnalytics.h |
Contains WLAnalytics methods that manage analytics logs.
Tasks
– addDeviceEventListener:
– removeDeviceEventListener:
– enable
– disable
– send
– sendWithDelegate:
– log:withMetadata:
– setUserContext:
– unsetUserContext
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 we want user-based analytics, we 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
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
© Copyright IBM Corp. 2017