Class for BlackBerry Analytics and BlackBerry Persona. More...
#import <BAFBlackberryAnalytics.h>
BlackBerry Analytics provides developers and UEM administrators metrics about the BlackBerry Dynamics apps and devices in an organization's environment. BlackBerry Dynamics apps with this feature enabled by their administrator will periodically send events (including startup, crash information) and data (including OS, minutes used, app name, version) to the BlackBerry Analytics platform. The BlackBerry Analytics platform processes and compiles the events and data into dashboard reports. An app developer can optionally use this programmatic interface to record usage of custom features or events within their app to enable these metrics to be included within the Analytics dashboard.
For more information, see the BlackBerry Analytics documentation.
BlackBerry Persona processes events and location data from BlackBerry Dynamics apps to assess a user’s security risk level based on their real-world context, and adjusts the user’s device and app behavior based on their current risk level. For example, if a user’s app data reports a geographic location that is not typical for the user, BlackBerry Persona can dynamically limit the user’s access to work apps or disable certain device features such as the camera. In addition, it can be configured by the enterprise administrator to enforce stricter authentication requirements by applying an override policy.
This service requires enabling and configuration by the enterprise administrator. In addition, application developers are required to perform steps to enable BlackBerry Persona.
Implement these step to enable Persona within a BlackBerry Dynamics application.
1. Add the following custom properties to the Info
section of your project target in Xcode. The resulting Info.plist
file should contain:
2. Add a setting in the application user interface for end users to enable or disable BlackBerry Persona.
This setting should ideally be implemented within the 'Settings' or 'Preferences' section of your application's user interface. When the user selects a menu item called 'BlackBerry Persona Settings' the application should call the method displaySISsettings (BAFBlackberryAnalytics). This triggers the runtime to display a settings screen which provides the user the option to opt in or out of using location based information when assessing their current risk level. This is a legal requirement to ensure end users are able to opt out of location data collection at any time. It is best practice to only show this option to users who have BlackBerry Persona enabled by their administrator, see isSISenabled (BAFBlackberryAnalytics).
For more information, see the BlackBerry Persona documentation.
Class Methods | |
(void) | + trackFeatureEvent:withFeatureName:completion: |
Record feature events to analyse the period a specific app feature is used. More... | |
(void) | + trackApplicationEvent:withValue:forKey:completion: |
Record adoption events to analyse the frequency of specific user actions or events. More... | |
(void) | + trackSecurityEvent:withEventValue: |
Register a security event which will trigger BlackBerry Persona risk analysis. More... | |
(void) | + trackAppUsagePattern:version:data:completion: |
Track App Usage events to detect anomalies in user behaviour. More... | |
(BOOL) | + isSISenabled |
Determine if BlackBerry Persona is enabled for the current user by their administrator. More... | |
(void) | + displaySISsettings |
Show a settings screen to enable the user to manage BlackBerrry Persona. More... | |
(void) | + sendGDAppEvent: |
Deprecated method. More... | |
+ (void) trackFeatureEvent: | (BAFAnalyticsEvent) | event | |
withFeatureName: | (NSString *_Nonnull) | featureName | |
completion: | (_Nullable BAFAnalyticsResponseCompletion) | completion | |
Call to record an event that has a start point (a "feature active event") followed by a stop point (a "feature inactive event"). The start and stop points provide a period of time where the feature was active. This type of event is typically used to measure user engagement of app features. The name that is used to track a feature must be unique within the app.
event | BAFAnalyticsEvent specifies the type of event. For example, FEATURE_ACTIVE or FEATURE_INACTIVE . |
featureName | NSString containing the name of the feature for a given event. |
completion | The completion block to be invoked when the operation completes. BAFAnalyticsResponse will return RECORD_SUCCESS if event is valid or a specific error otherwise. |
+ (void) trackApplicationEvent: | (BAFAnalyticsEvent) | event | |
withValue: | (NSString *_Nonnull) | eventValue | |
forKey: | (NSString *_Nonnull) | eventKey | |
completion: | (_Nullable BAFAnalyticsResponseCompletion) | completion | |
Call to record an event which occurs in your application. An adoption event has two attributes, key and value. The key must be unique within the app, and the value is a count of the number of times a specific event occurs (for example, an event key called "Emails deleted" that tracks the number of emails deleted by a user). The adoption event value should be the string representation of the integer count. An app can combine events and record a single event.
event | AnalyticsEvent specifies the type of event. In this case use ADOPTION_EVENT . |
eventValue | NSString containing the event value to record for the given event key. |
eventKey | NSString to define the name of the event. |
completion | The completion block to be invoked when the operation completes. BAFAnalyticsResponse will return RECORD_SUCCESS if event is valid or a specific error otherwise. |
+ (void) trackSecurityEvent: | (BAFSecurityEventType) | eventType | |
withEventValue: | (NSString *_Nullable) | eventVal | |
BlackBerry Persona risk analysis is performed by default when an application is brought to the foreground. To trigger risk analysis at other points in your application life-cycle, use this method to register the appropriate events. For example, your application could trigger risk analysis if a file is shared, money is transferred, or data is deleted.
Call this method setting the eventVal
to correspond with the specific application event which should trigger risk analysis, e.g. 'SHARE_FILE'. Set SecurityEventType to SECURITY_ADOPTION_EVENT
or other appropriate SecurityEventType. After you've successfully registered the security event, all subsequent calls, in this example, to trackApplicationEvent with the eventKey of 'SHARE_FILE' will trigger BlackBerry Persona risk analysis.
eventType | Specifies BAFSecurityEventType which event type should be security event. |
eventVal | Specifies name/label to associate with security event. |
+ (void) trackAppUsagePattern: | (BISAppUsageEventType) | eventType | |
version: | (NSUInteger) | version | |
data: | (NSDictionary< NSString *, NSObject * > *_Nonnull) | appData | |
completion: | (_Nullable BAFAnalyticsResponseCompletion) | completion | |
BlackBerry Persona can perform enhanced risk analysis and continuous authentication by tracking anomalies in user behavior. The risk engine can detect a user's anomalous app usage behavior and enforce user identity either by requiring a user to re-authenticate to confirm their identity, or by applying predefined policy.
eventType | specifies BISAppUsageEventType. |
version | specifies track api version. |
appData | specifies app usage data of app feature. |
completion | The completion block to be invoked when the operation completes. |
To instrument user actions in your application, construct the following information to send within appData:
The following schema applies to the payload sent within appData
If your application contains disparate capabilities, subdivide these into modules, e.g. payments, email, editor.
Identify a set of custom eventTypes which correspond to specific user actions within each module. The following are examples of events that you may wish to track.
The following is an example of JSON payload for appData.
+ (BOOL) isSISenabled |
Call this method to determine if BlackBerry Persona is enabled for the current user. For help see 'Steps to configure and use BlackBerry Persona' within the BlackBerry Persona documentation.
+ (void) displaySISsettings |
Show a settings screen to enable the user to manage BlackBerrry Persona. The settings screen provides the user the option to opt in or out of using location based information when assessing their current risk level. The settings can only be changed if BlackBerry Persona is enabled for the user by the administrator.
+ (void) sendGDAppEvent: | ((deprecated("Remove sendGDAppEvent: no longer required from this version"))) | __attribute__ |