Merge pull request #1480 from mapbox/1ec5-metrics-keys

Rename settings keys
This commit is contained in:
Minh Nguyễn
2015-05-08 12:06:51 -07:00
3 changed files with 6 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<dict>
<key>Title</key>
<string>Privacy Settings</string>
<key>Type</key>
@@ -16,7 +16,7 @@
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>mapbox_metrics_enabled_preference</string>
<string>MGLMapboxMetricsEnabled</string>
<key>Title</key>
<string>Mapbox Metrics</string>
<key>Type</key>

View File

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

View File

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