Fix root.plist flag conversion. (#288)

* Fix root.plist flag conversion.

* Update changelog.
This commit is contained in:
Fabian Guerra Soto
2020-04-30 13:54:31 -05:00
committed by GitHub
parent 4908bc1de7
commit 76f58c5385
2 changed files with 4 additions and 2 deletions

View File

@@ -187,7 +187,7 @@ static void * MGLTelemetryAccessTokenKeyContext = &MGLTelemetryAccessTokenKeyCon
if (!metricsEnabledSettingShownInAppFlag &&
[[NSUserDefaults mme_configuration] integerForKey:MGLMapboxAccountTypeKey] == 0) {
// Opt-out is not configured in UI, so check for Settings.bundle
id defaultEnabledValue;
BOOL defaultEnabledValue = NO;
NSString *appSettingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
if (appSettingsBundle) {
@@ -196,7 +196,8 @@ static void * MGLTelemetryAccessTokenKeyContext = &MGLTelemetryAccessTokenKeyCon
NSArray *preferences = settings[@"PreferenceSpecifiers"];
for (NSDictionary *prefSpecification in preferences) {
if ([prefSpecification[@"Key"] isEqualToString:MGLMapboxMetricsEnabledKey]) {
defaultEnabledValue = prefSpecification[@"DefaultValue"];
NSNumber *defaultValue = prefSpecification[@"DefaultValue"];
defaultEnabledValue = [defaultValue boolValue];
}
}
}