From bb788f56f268cfebba2105be7e23744779cad7b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 8 May 2015 11:51:48 -0700 Subject: [PATCH] Renamed settings keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new keys fit the standard naming convention for Info.plist keys and more clearly communicate how they’re to be used. --- ios/app/Settings.bundle/Root.plist | 4 ++-- platform/darwin/http_request_nsurl.mm | 2 +- platform/ios/MGLMapboxEvents.m | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/app/Settings.bundle/Root.plist b/ios/app/Settings.bundle/Root.plist index f3a995024..076f402e1 100644 --- a/ios/app/Settings.bundle/Root.plist +++ b/ios/app/Settings.bundle/Root.plist @@ -4,7 +4,7 @@ PreferenceSpecifiers - + Title Privacy Settings Type @@ -16,7 +16,7 @@ DefaultValue Key - mapbox_metrics_enabled_preference + MGLMapboxMetricsEnabled Title Mapbox Metrics Type diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm index 0006dbef8..5ab4e1b43 100644 --- a/platform/darwin/http_request_nsurl.mm +++ b/platform/darwin/http_request_nsurl.mm @@ -154,7 +154,7 @@ void HTTPRequest::start() { @autoreleasepool { NSMutableString *url = [NSMutableString stringWithString:@(resource.url.c_str())]; - if ([[NSUserDefaults standardUserDefaults] objectForKey:@"mapbox_metrics_disabled"] == nil) { + if ([[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"] == 0) { if ([url rangeOfString:@"?"].location == NSNotFound) { [url appendString:@"?"]; } else { diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 93891217c..fe19291ab 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -221,7 +221,7 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; static MGLMapboxEvents *_sharedManager; dispatch_once(&onceToken, ^{ if ( ! NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent && - [[NSUserDefaults standardUserDefaults] objectForKey:@"mapbox_metrics_disabled"] == nil) { + [[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"] == 0) { void (^setupBlock)() = ^{ _sharedManager = [[self alloc] init]; }; @@ -326,8 +326,8 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; MGLMapboxEvents *strongSelf = weakSelf; if ( ! strongSelf) return; - // Opt Out Checking When Built - if (![[NSUserDefaults standardUserDefaults] boolForKey:@"mapbox_metrics_enabled_preference"]) { + // User has opted out + if (![[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsEnabled"]) { [_eventQueue removeAllObjects]; return; }