Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios] Add enabled.telemetry key to turnstile event
Browse files Browse the repository at this point in the history
Supercedes #3496
  • Loading branch information
friedbunny committed Jan 19, 2016
1 parent f5c9adc commit 20c0690
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions platform/ios/src/MGLMapboxEvents.m
Original file line number Diff line number Diff line change
Expand Up @@ -389,29 +389,25 @@ - (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]],
@"vendorId": vid,
@"version": @(version)
};
NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
NSDictionary *vevt = @{
@"event" : MGLEventTypeAppUserTurnstile,
@"created" : [strongSelf.rfc3339DateFormatter stringFromDate:[NSDate date]],
@"vendorId": idfv,
@"version": @(version),
@"enabled.telemetry": @([[strongSelf class] isEnabled])
};

// Add to Queue
[_eventQueue addObject:vevt];
[_eventQueue addObject:vevt];

// Flush
[strongSelf flush];
[strongSelf flush];
});
}

Expand Down

0 comments on commit 20c0690

Please sign in to comment.