From a5bd2fa3c66991ff31ba5d4091eb8400f6fc4397 Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Wed, 20 May 2015 12:31:20 -0500 Subject: [PATCH] #1595 - Adding exception so that Turnstile event will always be sent in --- platform/ios/MGLMapboxEvents.m | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 002e38d9d..364a05180 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -432,9 +432,25 @@ const NSTimeInterval MGLFlushInterval = 60; __weak MGLMapboxEvents *weakSelf = self; dispatch_async(_serialQueue, ^{ + + if ([MGLEventTypeAppUserTurnstile isEqualToString:event]) { + // Build only IDFV event + NSString *vid = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; + NSDictionary *vevt = @{@"vendorId": vid}; + + // Add to Queue + [_eventQueue addObject:vevt]; + + // Flush + [MGLMapboxEvents flush]; + + return; + } + MGLMapboxEvents *strongSelf = weakSelf; + if ( ! strongSelf) return; - + // Metrics Collection Has Been Paused if (_paused) { return;