summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall C Lee <randallee@gmail.com>2019-05-08 16:49:04 -0400
committerRandall C Lee <randallee@gmail.com>2019-05-08 16:49:04 -0400
commita21258238a060769a06ba97a29cef2c4c5bb96e5 (patch)
treecba04b8884703a614eef8241df0e6fe54ebd59e3
parentfc218f8209fe5e8a9da0b772fb72407f11347a46 (diff)
downloadqtlocation-mapboxgl-a21258238a060769a06ba97a29cef2c4c5bb96e5.tar.gz
Set access token and only the access tokenupstream/rclee-set-access-token
-rw-r--r--platform/darwin/src/MGLAccountManager.m2
-rw-r--r--platform/ios/src/MGLMapboxEvents.h1
-rw-r--r--platform/ios/src/MGLMapboxEvents.m4
3 files changed, 6 insertions, 1 deletions
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;