#1516 - Renaming setShowsOptOutInApp to setMapboxMetricsEnabledSettingShownInApp for app consistency. Implementing wordsmith edits to NSAssert text. Removing technical debt.

This commit is contained in:
Brad Leege
2015-05-12 10:50:46 -05:00
parent 48e21ae6e9
commit 87551c6d0e
3 changed files with 6 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
@interface MGLAccountManager : NSObject
+ (void) setShowsOptOutInApp:(BOOL)showsOptOut;
+ (void) setMapboxMetricsEnabledSettingShownInApp:(BOOL)showsOptOut;
+ (void) setAccessToken:(NSString *) accessToken;
+ (NSString *) accessToken;

View File

@@ -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;
}

View File

@@ -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 {