From 4edd1e9658eb17de98e06a3213d33c7538259655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 18 Apr 2016 00:34:25 -0700 Subject: [PATCH] [ios] Use staging server in simulator Use the staging telemetry server when compiled for the iOS Simulator. Fixes #3621. --- platform/ios/app/MBXViewController.m | 1 - platform/ios/src/MGLMapboxEvents.m | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 45fc94ffa..de9565091 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -42,7 +42,6 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { @"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 7e6add662..f4acc0118 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -140,6 +140,9 @@ const NSTimeInterval MGLFlushInterval = 180; @"MGLMapboxAccountType": accountTypeNumber ?: @0, @"MGLMapboxMetricsEnabled": @YES, @"MGLMapboxMetricsDebugLoggingEnabled": @NO, +#if TARGET_OS_SIMULATOR + @"MGLTelemetryTestServerURL": @"https://cloudfront-staging.tilestream.net", +#endif }]; } } @@ -360,7 +363,7 @@ const NSTimeInterval MGLFlushInterval = 180; [self pushTurnstileEvent]; } - if ([self isPaused]) { + if (self.paused) { return; } @@ -450,7 +453,7 @@ const NSTimeInterval MGLFlushInterval = 180; // Called implicitly from public use of +flush. // - (void)postEvents:(NS_ARRAY_OF(MGLMapboxEventAttributes *) *)events { - if ([self isPaused]) { + if (self.paused) { return; }