diff options
author | Nadia Barbosa <nadiabarbosa@me.com> | 2019-04-29 17:19:38 -0700 |
---|---|---|
committer | Nadia Barbosa <captainbarbosa@users.noreply.github.com> | 2019-05-01 18:30:46 -0700 |
commit | 3e4afbc788424ef4d89d48f4d29204d1593f769d (patch) | |
tree | eec17784d7f5fcad6bc83fc8ffc4ce871a81f0cc /platform/ios/app/MBXAppDelegate.m | |
parent | 8b91a4a037ab84cafd40b62da0224e3baf100168 (diff) | |
download | qtlocation-mapboxgl-3e4afbc788424ef4d89d48f4d29204d1593f769d.tar.gz |
[iosapp] Move token setting to build script
[ios] Switch to script-based token insertion for benchmarking app
[ios] Update Developing.md
[iosapp, benchmark app] Look for token file outside of version-controlled directory
[iosapp, benchmark app] Remove remaining code for access token checking from app delegates
Feedback edits for @friedbunny
Diffstat (limited to 'platform/ios/app/MBXAppDelegate.m')
-rw-r--r-- | platform/ios/app/MBXAppDelegate.m | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/platform/ios/app/MBXAppDelegate.m b/platform/ios/app/MBXAppDelegate.m index 6abee91557..519c70766a 100644 --- a/platform/ios/app/MBXAppDelegate.m +++ b/platform/ios/app/MBXAppDelegate.m @@ -2,8 +2,6 @@ #import "MBXViewController.h" #import <Mapbox/Mapbox.h> -NSString * const MBXMapboxAccessTokenDefaultsKey = @"MBXMapboxAccessToken"; - @interface MBXAppDelegate() <MGLMetricsManagerDelegate> @end @@ -12,25 +10,11 @@ NSString * const MBXMapboxAccessTokenDefaultsKey = @"MBXMapboxAccessToken"; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Set access token, unless MGLAccountManager already read it in from Info.plist. - if ( ! [MGLAccountManager accessToken]) { - NSString *accessToken = [[NSProcessInfo processInfo] environment][@"MAPBOX_ACCESS_TOKEN"]; - if (accessToken) { - // Store to preferences so that we can launch the app later on without having to specify - // token. - [[NSUserDefaults standardUserDefaults] setObject:accessToken forKey:MBXMapboxAccessTokenDefaultsKey]; - } else { - // Try to retrieve from preferences, maybe we've stored them there previously and can reuse - // the token. - accessToken = [[NSUserDefaults standardUserDefaults] objectForKey:MBXMapboxAccessTokenDefaultsKey]; - } - [MGLAccountManager setAccessToken:accessToken]; #ifndef MGL_DISABLE_LOGGING - [MGLLoggingConfiguration sharedConfiguration].loggingLevel = MGLLoggingLevelFault; + [MGLLoggingConfiguration sharedConfiguration].loggingLevel = MGLLoggingLevelFault; #endif - [MGLMetricsManager sharedManager].delegate = self; - } + [MGLMetricsManager sharedManager].delegate = self; return YES; } |