diff options
author | Jason Wray <jason@mapbox.com> | 2019-08-20 16:11:11 -0700 |
---|---|---|
committer | Jason Wray <friedbunny@users.noreply.github.com> | 2019-08-21 12:14:20 -0700 |
commit | 0e57c7de4401ed67854b64b1bbc26edf04e2e07c (patch) | |
tree | 78e56c481631946d1a1c22a129a887ed02ef1f1c /platform/darwin | |
parent | c3cd9002f0f59ff6955c75410aaae62fb782935d (diff) | |
download | qtlocation-mapboxgl-0e57c7de4401ed67854b64b1bbc26edf04e2e07c.tar.gz |
[ios] Refactor NSUserDefaults key variable names
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/src/MGLAccountManager.m | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLAccountManager_Private.h | 3 | ||||
-rw-r--r-- | platform/darwin/src/http_file_source.mm | 9 |
3 files changed, 9 insertions, 5 deletions
diff --git a/platform/darwin/src/MGLAccountManager.m b/platform/darwin/src/MGLAccountManager.m index 69170459bc..c37195967a 100644 --- a/platform/darwin/src/MGLAccountManager.m +++ b/platform/darwin/src/MGLAccountManager.m @@ -13,6 +13,8 @@ static NSString * const MGLAccountManagerExternalClassName = @"MBXAccounts"; static NSString * const MGLAccountManagerExternalMethodName = @"skuToken"; #endif +NSString * const MGLMapboxAccountTypeKey = @"MGLMapboxAccountType"; + @interface MGLAccountManager () @property (atomic) NSString *accessToken; diff --git a/platform/darwin/src/MGLAccountManager_Private.h b/platform/darwin/src/MGLAccountManager_Private.h index 3fd45f1ae8..4bf7963182 100644 --- a/platform/darwin/src/MGLAccountManager_Private.h +++ b/platform/darwin/src/MGLAccountManager_Private.h @@ -2,6 +2,9 @@ NS_ASSUME_NONNULL_BEGIN +/// NSUserDefaults key that controls developer account type +FOUNDATION_EXTERN NSString * const MGLMapboxAccountTypeKey; + @interface MGLAccountManager (Private) /// Returns the shared instance of the `MGLAccountManager` class. diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm index c2ed065ed8..b0f69f4a7f 100644 --- a/platform/darwin/src/http_file_source.mm +++ b/platform/darwin/src/http_file_source.mm @@ -88,15 +88,14 @@ class HTTPFileSource::Impl { public: Impl() { @autoreleasepool { - - NSURLSessionConfiguration *sessionConfig = - [MGLNetworkConfiguration sharedManager].sessionConfiguration; - + NSURLSessionConfiguration *sessionConfig = [MGLNetworkConfiguration sharedManager].sessionConfiguration; session = [NSURLSession sessionWithConfiguration:sessionConfig]; userAgent = getUserAgent(); - accountType = [[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"]; +#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR + accountType = [[NSUserDefaults standardUserDefaults] integerForKey:MGLMapboxAccountTypeKey]; +#endif } } |