summaryrefslogtreecommitdiff
path: root/ios/app
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-05-13 22:33:03 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-05-13 22:33:03 -0700
commit0ad76c95d20f7ef7b7ef712d8edb8c54219880e7 (patch)
tree2996293e2eff82b7d65032a0cffa56b796d3838a /ios/app
parent164ff72297a0b57c42cc5dc1299e6b7f1dd13db9 (diff)
downloadqtlocation-mapboxgl-0ad76c95d20f7ef7b7ef712d8edb8c54219880e7.tar.gz
Obsoleted +setMapboxMetricsEnabledSettingShownInApp:
Made `+[MGLAccountManager setMapboxMetricsEnabledSettingShownInApp:]` unavailable, with a message explaining what to do instead. Removed a commented-out call to that method. Only the environment for an access token if one hasn’t already been set in Info.plist.
Diffstat (limited to 'ios/app')
-rw-r--r--ios/app/MBXAppDelegate.m32
1 files changed, 15 insertions, 17 deletions
diff --git a/ios/app/MBXAppDelegate.m b/ios/app/MBXAppDelegate.m
index ce699ce694..39868b174f 100644
--- a/ios/app/MBXAppDelegate.m
+++ b/ios/app/MBXAppDelegate.m
@@ -8,24 +8,22 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
- // Set Access Token
- 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:@"access_token"];
- } else {
- // Try to retrieve from preferences, maybe we've stored them there previously and can reuse
- // the token.
- accessToken = [[NSUserDefaults standardUserDefaults] objectForKey:@"access_token"];
+ // 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:@"access_token"];
+ } else {
+ // Try to retrieve from preferences, maybe we've stored them there previously and can reuse
+ // the token.
+ accessToken = [[NSUserDefaults standardUserDefaults] objectForKey:@"access_token"];
+ }
+ if ( ! accessToken) NSLog(@"No access token set. Mapbox vector tiles won't work.");
+
+ [MGLAccountManager setAccessToken:accessToken];
}
- if ( ! accessToken) NSLog(@"No access token set. Mapbox vector tiles won't work.");
-
- // Signal To SDK That Opt Out Is In App UI
-// [MGLAccountManager setMapboxMetricsEnabledSettingShownInApp:YES];
-
- // Start Mapbox GL SDK
- [MGLAccountManager setAccessToken:accessToken];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[MBXViewController new]];