Skip to content

Commit 1f0c6e5

Browse files
committed
fix: android disabling telemetry too soon
1 parent 44081bf commit 1f0c6e5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/mapbox.android.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,7 @@ export class MapboxView extends MapboxViewBase {
400400

401401
if (!this.nativeMapView && ((this.config && this.config.accessToken) || (this.settings && this.settings.accessToken))) {
402402
this.mapbox = new Mapbox();
403-
if (this.telemetry === false) {
404-
com.mapbox.mapboxsdk.Mapbox.getTelemetry().setUserTelemetryRequestState(false);
405-
}
403+
406404

407405

408406
// the NativeScript contentview class extends from Observable to provide the notify method
@@ -429,7 +427,14 @@ export class MapboxView extends MapboxViewBase {
429427
});
430428
},
431429
onMapReady: (map) => {
432-
430+
if (this.telemetry === false) {
431+
try{
432+
com.mapbox.mapboxsdk.Mapbox.getTelemetry().setUserTelemetryRequestState(false);
433+
console.error('telemtry disabled!')
434+
} catch(err) {
435+
console.error('telemtry', err)
436+
}
437+
}
433438
if (Trace.isEnabled()) {
434439
CLog(CLogTypes.info, 'initMap(): onMapReady event - calling notify with the MapboxViewBase.mapReadyEvent');
435440
}

0 commit comments

Comments
 (0)