diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 329117394f9..37314ba784b 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -11,6 +11,7 @@ Mapbox welcomes participation and contributions from everyone. If you’d like - Fixed an issue preventing KVO change notifications from being generated on MGLMapView’s `userTrackingMode` key path when `-setUserTrackingMode:animated:` is called. ([#4724](https://github.com/mapbox/mapbox-gl-native/pull/4724)) - Added a `-reloadStyle:` action to MGLMapView to force a reload of the current style. ([#4728](https://github.com/mapbox/mapbox-gl-native/pull/4728)) - A more specific user agent string is now sent with style and tile requests. ([#4012](https://github.com/mapbox/mapbox-gl-native/pull/4012)) +- Mapbox Telemetry is automatically disabled while the host application is running in the iOS Simulator. ([#4726](https://github.com/mapbox/mapbox-gl-native/pull/4726)) - Removed unused SVG files from the SDK’s resource bundle. ([#4641](https://github.com/mapbox/mapbox-gl-native/pull/4641)) - Deprecated `-[MGLMapView emptyMemoryCache]`. ([#4725](https://github.com/mapbox/mapbox-gl-native/pull/4725)) diff --git a/platform/ios/app/Info.plist b/platform/ios/app/Info.plist index 0e5316d333c..e56954833bb 100644 --- a/platform/ios/app/Info.plist +++ b/platform/ios/app/Info.plist @@ -24,17 +24,6 @@ 7877 LSRequiresIPhoneOS - NSAppTransportSecurity - - NSExceptionDomains - - cloudfront-staging.tilestream.net - - NSExceptionRequiresForwardSecrecy - - - - NSHumanReadableCopyright © 2014–2016 Mapbox NSLocationAlwaysUsageDescription diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 45fc94ffa62..de9565091e5 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -42,7 +42,6 @@ + (void)initialize @"MBXUserTrackingMode": @(MGLUserTrackingModeNone), @"MBXShowsUserLocation": @NO, @"MBXDebug": @NO, - @"MGLTelemetryTestServerURL": @"https://cloudfront-staging.tilestream.net", }]; } } diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m index 7e6add662ef..ce07c5602de 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -145,8 +145,12 @@ + (void)initialize { } + (BOOL)isEnabled { +#if TARGET_OS_SIMULATOR + return NO; +#else return ([[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsEnabled"] && [[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"] == 0); +#endif } - (BOOL)debugLoggingEnabled { @@ -360,7 +364,7 @@ - (void)pushEvent:(NSString *)event withAttributes:(MGLMapboxEventAttributes *)a [self pushTurnstileEvent]; } - if ([self isPaused]) { + if (self.paused) { return; } @@ -450,7 +454,7 @@ - (MGLMapboxEventAttributes *)eventForAttributes:(MGLMutableMapboxEventAttribute // Called implicitly from public use of +flush. // - (void)postEvents:(NS_ARRAY_OF(MGLMapboxEventAttributes *) *)events { - if ([self isPaused]) { + if (self.paused) { return; } diff --git a/platform/ios/uitest/App-Info.plist b/platform/ios/uitest/App-Info.plist index 8753067af17..ab5ac7ec8ce 100644 --- a/platform/ios/uitest/App-Info.plist +++ b/platform/ios/uitest/App-Info.plist @@ -28,8 +28,6 @@ pk.eyJ1IjoianVzdGluIiwiYSI6Ik9RX3RRQzAifQ.dmOg_BAp1ywuDZMM7YsXRg MGLMapboxMetricsEnabledSettingShownInApp - MGLMetricsTestServerURL - https://cloudfront-staging.tilestream.net NSLocationAlwaysUsageDescription Strictly for testing purposes, promise! UILaunchStoryboardName