Telemetry configuration
The Extended flavor of Maps and Navigation SDK for Android is only available upon request. Contact us to get started.
Introduction
In this guide, you will learn how to configure the Telemetry module and adjust the end user consent level.
The collection and utilization of end-user personal data is subject to a range of local privacy regulations, including the General Data Protection Regulation (GDPR). To assist integrators in adhering to these requirements, The TomTom Navigation SDK provides built-in support for implementing consent management via the Telemetry API.
Project setup
Configure the project as described in the Project setup guide. Then add the following dependencies to the build.gradle.kts file of your application module and synchronize the project as shown in the following example:
val version = "2.3.0"implementation("com.tomtom.sdk.telemetry:telemetry:$version")
Request and obtain user consent
It is the integrator’s responsibility to collect consent from the user during onboarding, settings interaction, or any other appropriate touchpoint. This includes presenting a user interface that clearly informs the user about data usage, the types of data collected, and the implications of each consent level. The consent flow must meet applicable privacy regulations such as GDPR (EU) and CCPA (California), and must be designed and implemented by the integrator.
TomTom Navigation SDK requires the current consent state every time it starts up; the integrator must explicitly set this value via the Telemetry API to ensure TomTom Navigation SDK initializes correctly.
Communicate consent to the TomTom Navigation SDK
Once the user selects or updates their consent preferences, the integrator must communicate the selected consent level to the The TomTom Navigation SDK using the Telemetry API. This API is designed to register the user’s choice so that the TomTom Navigation SDK can adjust its feature behavior accordingly.
Basic configuration
You can use the Telemetry object to configure what telemetry data the SDK sends. Initialize the Telemetry object before you start using any SDK component. To initialize it, you must provide an instance of DefaultTelemetryConfigProvider configured with your API key, LocationProvider, and an initial end-user consent level.
1Telemetry.initialize(2 context,3 DefaultTelemetryConfigProvider(context, "TOMTOM_API_KEY"),4 locationProvider,5 UserConsent.TelemetryOn,6)
If the initial user consent is not immediately available (for example, if it must be fetched from a remote server or local storage), you can use the getInitialConsent: suspend () → UserConsent parameter. This allows you to initialize Telemetry asynchronously while the consent value is being retrieved.
1Telemetry.initialize(2 context,3 DefaultTelemetryConfigProvider(context, "TOMTOM_API_KEY"),4 locationProvider,5 suspend { UserConsent.TelemetryOn },6)
You must initialize Telemetry (or explicitly opt out) before using any other SDK modules. Failure to do so will result in an exception.
Telemetry is not considered initialized if it doesn’t receive an initial consent as part of its
initializefunction.Telemetry initialization can only be performed once. Any subsequent attempt to reinitialize Telemetry will result in an exception.
Start the
LocationProviderupdates before initializing Telemetry to avoid warnings.
User consent
You can enable or disable telemetry data collection for an end user by using the setConsent function.
TelemetryOff results in the SDK sending no telemetry data.
LocationOnly allows the SDK to send only timestamped current location probe data of the end user.
TelemetryOn results in the SDK sending all the telemetry data.
Telemetry.setConsent(consent)
Unless agreed differently in the contract, we ask our customers to only enable an end user to use the live Traffic services if the user simultaneously consents to at least the location probe data telemetry data collection consent.
Opt-out
If your contract permits opting out of telemetry data collection, you can completely disable telemetry by not initializing the Telemetry module and do the following before using any SDK module:
Telemetry.setConsent(UserConsent.TelemetryOff)