diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m index 5fc062a2a2e..c0f8693fd7d 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -391,31 +391,27 @@ - (void)startUpdatingLocation { } - (void) pushTurnstileEvent { - __weak MGLMapboxEvents *weakSelf = self; dispatch_async(_serialQueue, ^{ - MGLMapboxEvents *strongSelf = weakSelf; if ( ! strongSelf) return; - // Build only IDFV event - NSString *vid = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; - NSDictionary *vevt = @{ - @"event" : MGLEventTypeAppUserTurnstile, - @"created" : [strongSelf.rfc3339DateFormatter stringFromDate:[NSDate date]], - @"appBundleId" : strongSelf.appBundleId, - @"vendorId": vid, - @"version": @(version), - @"instance": strongSelf.instanceID - }; - - // Add to Queue - [_eventQueue addObject:vevt]; - - // Flush - [strongSelf flush]; + NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; + NSDictionary *vevt = @{ + @"event" : MGLEventTypeAppUserTurnstile, + @"created" : [strongSelf.rfc3339DateFormatter stringFromDate:[NSDate date]], + @"appBundleId" : strongSelf.appBundleId, + @"vendorId": idfv, + @"version": @(version), + @"instance": strongSelf.instanceID, + @"telemetry": @([[strongSelf class] isEnabled]) + }; + + [_eventQueue addObject:vevt]; + + [strongSelf flush]; }); }