Enabling Background Authorize for a BlackBerry Dynamics app
You can enable the Background Authorize feature to allow a recently locked BlackBerry Dynamics app to use the principal BlackBerry Dynamics APIs (such as secure storage and secure communication) when the app is running in the background. When enabled, a BlackBerry Dynamics app can unlock the container without a user's intervention.
Background Authorize is particularly useful when a BlackBerry Dynamics app stops unexpectedly, for example, if the OS unloads it from runtime memory. An app can be started in the background in response to a push notification (for example, APNs or FCM messages for new emails), a background fetch operation, or background tasks; if Background Authorize is enabled, the BlackBerry Dynamics app can authorize autonomously, download the new data or messages, and store them in the secure container. When the user brings the app to the foreground, they can authenticate and access the new data or messages without any delay.
A custom BlackBerry Dynamics app can enter the Background Authorize state if the following conditions are met:
- The app has started in the background and attempts to use
authorizeAutonomously(iOS) orserviceInit(Android). - Background Authorize is enabled in the app and is enabled in the BlackBerry Dynamics profile that is assigned to users (see Enable Background Authorize for a custom BlackBerry Dynamics app).
- The app has been unlocked at least once since the last device restart.
- The user has authenticated with the app in the last 3 days.
- The device is not running in low power mode.
Previously, Background Authorize was a restricted API that required a request to BlackBerry to enable. As of the BlackBerry Dynamics SDK version 14.0, Background Authorize is no longer restricted and can be implemented for any custom BlackBerry Dynamics app.