Real-Time Listeners
Overview
Instead of querying the SDK for data or insights, you can subscribe to listeners to receive notifications whenever specific events occur or when insights are processed and available. This is done through listeners.
Listeners can operate:
In the foreground – while the app is open and visible.
In the background – even when the app is closed or the screen is turned off.
Background listeners are available for the following main features:
Driving Insights Notifies when a transport is fully processed and driving insights are available.
Lifestyle Insights Notifies when the user's current context changes (e.g. a new segment is detected, the user's venue is detected (such as home or work), or the user transitions between stationary and transport).
Mobility Insights Notifies when a new timeline event is detected (e.g., stationary, transport).
Smart Geofences Notifies when the user enters or exits a place of interest.
Crash Detection Near real-time notification when a crash is detected, including crash details.
SDK Status Changes Notifies when the SDK's status changes (permissions, location availability, detection status, etc.).
Platform Configuration
When implementing background listeners, you must include the required platform dependencies and perform the necessary initialization in the native code of your application.
Refer to the code examples below to understand how to register and initialize background listeners. In the following example, we use the Event Timeline listener, but the same workflow applies to the other background listeners.
Last updated