From 76f58c5385ea80cf18ccc110484c2f1847851651 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Thu, 30 Apr 2020 13:54:31 -0500 Subject: [PATCH] Fix root.plist flag conversion. (#288) * Fix root.plist flag conversion. * Update changelog. --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapboxEvents.m | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 553dd9dc9..6a63d501a 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -21,6 +21,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed an issue where an `MGLMapSnapshotOptions` with an invalid `MGLMapCamera.centerCoordinate`, negative `MGLMapCamera.heading`, negative `MGLMapCamera.pitch`, and negative `MGLMapSnapshotOptions.zoomLevel` resulted in a snapshot centered on Null Island at zoom level 0 even if the style specified a different initial center coordinate or zoom level. ([#280](https://github.com/mapbox/mapbox-gl-native-ios/pull/280)) * Fixed an error that occurred if your implementation of the `-[MGLOfflineStorageDelegate offlineStorage:URLForResourceOfKind:]` method returned a local file URL. ([mapbox/mapbox-gl-native#16428](https://github.com/mapbox/mapbox-gl-native/pull/16428)) * Certain logging statements no longer run on the main thread. ([mapbox/mapbox-gl-native#16325](https://github.com/mapbox/mapbox-gl-native/pull/16325)) +* Fixed an issue that prevented the Maps SDK from warning about a misconfiguration that violated the Mapbox ToS. ([#288](https://github.com/mapbox/mapbox-gl-native-ios/pull/288)) ## 5.8.0 diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m index 2ce0c7886..c174c6673 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -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]; } } }