mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
478 stars 134 forks source link

Disable Telemetry in Compose Attribution #2461

Open FloTank opened 3 months ago

FloTank commented 3 months ago

New Feature

When using the Attribution introduced in the Compose - MapboxMap in (and after up until the lastest Version) Version 11.3.0+, one can't disable telemetry afterwards by code anymore.


    MapboxMap(
        composeMapInitOptions = ComposeMapInitOptions(
            pixelRatio = context.resources.displayMetrics.density,
            textureView = true
        ),
        attribution = {
            Attribution(
                iconColor = attributionIconColor
            )
        },
    ) {
        MapEffect(Unit) { mapView ->
            mapView.attribution.apply {
                setCustomAttributionDialogManager(MapboxAttributionDialogManager(context))
                getMapAttributionDelegate().telemetry().apply {
                    userTelemetryRequestState = isMapTrackingAllowed
                    if (isMapTrackingAllowed.not()) disableTelemetrySession()
                }
            }
        }
    }

Previously with the AttributionSettings something like this was allowed, as the PluginId of the mapView.attribution was set. Now, after introducing the Attribution() Composable another Plugin Id is used, which we can't access so the mapView.attribution is not accessible anymore as it crashes.

As of right now I can't find a way to do the same things we did in the mapView.Attribution in the new Attribution Composable. A custom Dialog is possible but Telemetry can't be disabled.

Why

The User should also be able to disable telemetry in the App Settings so we need to pass it to MapBox

kiryldz commented 2 months ago

@FloTank thanks for reporting. We are tracking this internally and will let you know when it's implemented.

JanTie commented 2 weeks ago

Shouldn't this get like some high priority? Not being able to set the telemetry seems like a potential GDPR issue to me.