From a21258238a060769a06ba97a29cef2c4c5bb96e5 Mon Sep 17 00:00:00 2001 From: Randall C Lee Date: Wed, 8 May 2019 16:49:04 -0400 Subject: Set access token and only the access token --- platform/darwin/src/MGLAccountManager.m | 2 +- platform/ios/src/MGLMapboxEvents.h | 1 + platform/ios/src/MGLMapboxEvents.m | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/darwin/src/MGLAccountManager.m b/platform/darwin/src/MGLAccountManager.m index edcfbbcdf0..61f200ccbf 100644 --- a/platform/darwin/src/MGLAccountManager.m +++ b/platform/darwin/src/MGLAccountManager.m @@ -91,7 +91,7 @@ static BOOL _MGLAccountsSDKEnabled; #if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR dispatch_async(dispatch_get_main_queue(), ^{ - [MGLMapboxEvents setupWithAccessToken:accessToken]; + [MGLMapboxEvents setAccessToken:accessToken]; }); #endif } diff --git a/platform/ios/src/MGLMapboxEvents.h b/platform/ios/src/MGLMapboxEvents.h index cb3132656f..f7cae92b02 100644 --- a/platform/ios/src/MGLMapboxEvents.h +++ b/platform/ios/src/MGLMapboxEvents.h @@ -8,6 +8,7 @@ NS_ASSUME_NONNULL_BEGIN + (nullable instancetype)sharedInstance; + (void)setupWithAccessToken:(NSString *)accessToken; ++ (void)setAccessToken:(NSString *)accessToken; + (void)pushTurnstileEvent; + (void)pushEvent:(NSString *)event withAttributes:(MMEMapboxEventAttributes *)attributeDictionary; + (void)flush; diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m index bb16f77f98..18a9fad1ae 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -121,6 +121,10 @@ static NSString * const MGLVariableGeofence = @"VariableGeofence"; } } ++ (void)setAccessToken:(NSString *)accessToken { + [[[self sharedInstance] eventsManager] setAccessToken:accessToken]; +} + + (void)setupWithAccessToken:(NSString *)accessToken { int64_t delayTime = 0; -- cgit v1.2.1