From a29587726cb1cedd5dc95532b731c4d4b6d7932b Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Wed, 20 May 2015 14:32:16 -0500 Subject: [PATCH] #1595 - Moving MGLEventTypeAppUserTurnstile event to end of MGLMapboxEvents init method to ensure it only gets called once --- platform/ios/MGLAccountManager.m | 5 ++--- platform/ios/MGLMapboxEvents.m | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index 1a9bbe47a..a49433777 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -51,9 +51,8 @@ [[MGLAccountManager sharedManager] setAccessToken:accessToken]; // Update MGLMapboxEvents - // NOTE: This is (likely) the initial setup of MGLMapboxEvents (via implicit call to +[MGLMapboxEvents sharedManager]) - // Turn the Mapbox Turnstile to Count App Users - [MGLMapboxEvents pushEvent:MGLEventTypeAppUserTurnstile withAttributes:nil]; + // NOTE: This is (likely) the initial setup of MGLMapboxEvents + [MGLMapboxEvents sharedManager]; } + (NSString *) accessToken { diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 6b15df145..b6daaab3b 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -278,6 +278,9 @@ const NSTimeInterval MGLFlushInterval = 60; MGLMapboxEvents *strongSelf = weakSelf; [strongSelf validate]; }]; + + // Turn the Mapbox Turnstile to Count App Users + [self pushEvent:MGLEventTypeAppUserTurnstile withAttributes:nil]; } return self; }