From 87551c6d0e189cd6d98cc75e93ba4f0f176a3464 Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Tue, 12 May 2015 10:50:46 -0500 Subject: [PATCH] #1516 - Renaming setShowsOptOutInApp to setMapboxMetricsEnabledSettingShownInApp for app consistency. Implementing wordsmith edits to NSAssert text. Removing technical debt. --- include/mbgl/ios/MGLAccountManager.h | 2 +- platform/ios/MGLAccountManager.m | 6 +++--- platform/ios/MGLMapboxEvents.m | 8 ++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/mbgl/ios/MGLAccountManager.h b/include/mbgl/ios/MGLAccountManager.h index 7f4d0a556..f856f16cc 100644 --- a/include/mbgl/ios/MGLAccountManager.h +++ b/include/mbgl/ios/MGLAccountManager.h @@ -1,6 +1,6 @@ @interface MGLAccountManager : NSObject -+ (void) setShowsOptOutInApp:(BOOL)showsOptOut; ++ (void) setMapboxMetricsEnabledSettingShownInApp:(BOOL)showsOptOut; + (void) setAccessToken:(NSString *) accessToken; + (NSString *) accessToken; diff --git a/platform/ios/MGLAccountManager.m b/platform/ios/MGLAccountManager.m index f93f379f4..09bfb3db2 100644 --- a/platform/ios/MGLAccountManager.m +++ b/platform/ios/MGLAccountManager.m @@ -39,11 +39,11 @@ static MGLAccountManager *_sharedManager; return _sharedManager; } -+ (void) setShowsOptOutInApp:(BOOL)showsOptOut { - [[MGLAccountManager sharedInstance] setShowsOptOutInApp:showsOptOut]; ++ (void) setMapboxMetricsEnabledSettingShownInApp:(BOOL)showsOptOut { + [MGLAccountManager sharedInstance].showsOptOutInApp = showsOptOut; } -+ (BOOL) showsOptOutInApp { ++ (BOOL) mapboxMetricsEnabledSettingShownInApp { return [MGLAccountManager sharedInstance].showsOptOutInApp; } diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 0246d429e..244928f95 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -118,12 +118,12 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; self = [super init]; if (self) { - if (! [MGLAccountManager sharedInstance].showsOptOutInApp) { + if (! [MGLAccountManager mapboxMetricsEnabledSettingShownInApp]) { // Opt Out is not configured in UI, so check for Settings.bundle // Put Settings bundle into memory NSString *appSettingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"]; - NSAssert(appSettingsBundle, @"End Users must be able to opt out of Metrics in your app either via the Settings.bundle or in the app itself which must be noted via setting [MGLAccountManager setShowsOptOutInApp:YES]"); + NSAssert(appSettingsBundle, @"End users must be able to opt out of Metrics in your app, either via the Settings.bundle or in the app itself which must be noted via setting +[MGLAccountManager setShowsOptOutInApp:YES]"); // Dynamic Settings.bundle loading based on: // http://stackoverflow.com/questions/510216/can-you-make-the-settings-in-settings-bundle-default-even-if-you-dont-open-the @@ -246,10 +246,6 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; [self pauseMetricsCollection]; } -+ (void) setShowsOptOutInApp:(BOOL)showsOptOut { - -} - // Must be called from the main thread. // + (void) setToken:(NSString *)token {