diff options
author | Brad Leege <bleege@gmail.com> | 2015-05-20 11:32:57 -0500 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2015-05-20 11:32:57 -0500 |
commit | 58b967605aa882f93d0db220cae29a49444cc842 (patch) | |
tree | 917cfb2778f78d75654a467029f3b13fb47adf21 /platform | |
parent | f3d7212137021860b653a6e56fab4677407c68fb (diff) | |
download | qtlocation-mapboxgl-58b967605aa882f93d0db220cae29a49444cc842.tar.gz |
Implementing suggestions to tighten up MGLAccountManager and rename MGLEventTypeUserCount to MGLEventTypeAppUserTurnstile
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/MGLAccountManager.m | 8 | ||||
-rw-r--r-- | platform/ios/MGLMapboxEvents.h | 2 | ||||
-rw-r--r-- | platform/ios/MGLMapboxEvents.m | 5 |
3 files changed, 7 insertions, 8 deletions
diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index e0999ba296..1a9bbe47aa 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -51,11 +51,9 @@ [[MGLAccountManager sharedManager] setAccessToken:accessToken]; // Update MGLMapboxEvents - // NOTE: This is (likely) the initial setup of MGLMapboxEvents - [MGLMapboxEvents sharedManager]; - - // Count App Users - [MGLMapboxEvents pushEvent:MGLEventTypeAppUserCount withAttributes:nil]; + // 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]; } + (NSString *) accessToken { diff --git a/platform/ios/MGLMapboxEvents.h b/platform/ios/MGLMapboxEvents.h index 174c355148..00de64a8b0 100644 --- a/platform/ios/MGLMapboxEvents.h +++ b/platform/ios/MGLMapboxEvents.h @@ -1,6 +1,6 @@ #import <Foundation/Foundation.h> -extern NSString *const MGLEventTypeAppUserCount; +extern NSString *const MGLEventTypeAppUserTurnstile; extern NSString *const MGLEventTypeMapLoad; extern NSString *const MGLEventTypeMapTap; extern NSString *const MGLEventTypeMapDragEnd; diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 2d41bc2400..002e38d9d9 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -16,7 +16,7 @@ static NSString *const MGLMapboxEventsUserAgent = @"MapboxEventsiOS/1.0"; static NSString *MGLMapboxEventsAPIBase = @"https://api.tiles.mapbox.com"; -NSString *const MGLEventTypeAppUserCount = @"appUserCount"; +NSString *const MGLEventTypeAppUserTurnstile = @"appUserTurnstile"; NSString *const MGLEventTypeMapLoad = @"map.load"; NSString *const MGLEventTypeMapTap = @"map.click"; NSString *const MGLEventTypeMapDragEnd = @"map.dragend"; @@ -316,6 +316,7 @@ const NSTimeInterval MGLFlushInterval = 60; [[MGLMapboxEvents sharedManager] validate]; } +// Used to determine if Mapbox Metrics should be collected at any given point in time - (void)validate { MGLAssertIsMainThread(); BOOL enabledInSettings = [[self class] isEnabled]; @@ -482,7 +483,7 @@ const NSTimeInterval MGLFlushInterval = 60; [_eventQueue addObject:finalEvent]; // Has Flush Limit Been Reached? - if (_eventQueue.count >= MGLMaximumEventsPerFlush || [MGLEventTypeAppUserCount isEqualToString:event]) { + if (_eventQueue.count >= MGLMaximumEventsPerFlush || [MGLEventTypeAppUserTurnstile isEqualToString:event]) { [strongSelf flush]; } else if (_eventQueue.count == 1) { // If this is first new event on queue start timer, |