diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-04-18 16:02:19 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-04-18 16:56:14 -0700 |
commit | 7606fc6548728e356bf88bb01882be11cfc0913e (patch) | |
tree | e2282570d638dafcf5f219719d1830f5c822f185 /platform | |
parent | b3a2c0d53f97b0444f23a7e4ee1139db58e4e567 (diff) | |
download | qtlocation-mapboxgl-7606fc6548728e356bf88bb01882be11cfc0913e.tar.gz |
[ios] Disable telemetry in simulator
When running in the simulator, disable telemetry outright instead of pointing it to the staging server.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/CHANGELOG.md | 1 | ||||
-rw-r--r-- | platform/ios/src/MGLMapboxEvents.m | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 329117394f..37314ba784 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/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m index f4acc01185..ce07c5602d 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -140,16 +140,17 @@ const NSTimeInterval MGLFlushInterval = 180; @"MGLMapboxAccountType": accountTypeNumber ?: @0, @"MGLMapboxMetricsEnabled": @YES, @"MGLMapboxMetricsDebugLoggingEnabled": @NO, -#if TARGET_OS_SIMULATOR - @"MGLTelemetryTestServerURL": @"https://cloudfront-staging.tilestream.net", -#endif }]; } } + (BOOL)isEnabled { +#if TARGET_OS_SIMULATOR + return NO; +#else return ([[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsEnabled"] && [[NSUserDefaults standardUserDefaults] integerForKey:@"MGLMapboxAccountType"] == 0); +#endif } - (BOOL)debugLoggingEnabled { |