[ios] Convert telemetry test server setting to user default

- Previously looked in app's Info.plist, now looks at NSUserDefaults
This commit is contained in:
Jason Wray
2016-04-12 19:53:32 -04:00
parent ef65d2015c
commit 7e0a2e36e6
3 changed files with 4 additions and 7 deletions

View File

@@ -40,9 +40,8 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
@"MBXUserTrackingMode": @(MGLUserTrackingModeNone),
@"MBXShowsUserLocation": @NO,
@"MBXDebug": @NO,
@"MGLTelemetryTestServerURL": @"https://cloudfront-staging.tilestream.net",
}];
}
}

View File

@@ -24,8 +24,6 @@
<string>7877</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MGLMetricsTestServerURL</key>
<string>https://cloudfront-staging.tilestream.net</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
@@ -40,9 +38,9 @@
<key>NSHumanReadableCopyright</key>
<string>© 2014–2016 Mapbox</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>The map will ALWAYS display the user's location.</string>
<string>The map will ALWAYS display the user’s location.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>The map will display the user's location.</string>
<string>The map will display the user’s location.</string>
<key>UILaunchStoryboardName</key>
<string>Default</string>
<key>UIMainStoryboardFile</key>

View File

@@ -87,7 +87,7 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST";
}
- (void)setupBaseURL {
NSString *testServerURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLMetricsTestServerURL"];
NSString *testServerURL = [[NSUserDefaults standardUserDefaults] stringForKey:@"MGLTelemetryTestServerURL"];
if (testServerURL) {
_baseURL = testServerURL;
_usesTestServer = YES;