[ios] Disable telemetry in simulator

When running in the simulator, disable telemetry outright instead of pointing it to the staging server.
This commit is contained in:
Minh Nguyễn
2016-04-18 16:02:19 -07:00
committed by Minh Nguyễn
parent b3a2c0d53f
commit 7606fc6548
2 changed files with 5 additions and 3 deletions

View File

@@ -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 {