Merge pull request #1589 from mapbox/1396-info-plist-only

Manage Metrics TEST URL Via Info.plist
This commit is contained in:
Brad Leege
2015-05-18 21:40:26 -05:00
2 changed files with 9 additions and 1 deletions

View File

@@ -47,5 +47,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>MGLMetricsTestServerURL</key>
<string>https://cloudfront-staging.tilestream.net</string>
</dict>
</plist>

View File

@@ -14,7 +14,7 @@
#include <sys/sysctl.h>
static NSString *const MGLMapboxEventsUserAgent = @"MapboxEventsiOS/1.0";
static NSString *const MGLMapboxEventsAPIBase = @"https://api.tiles.mapbox.com";
static NSString *MGLMapboxEventsAPIBase = @"https://api.tiles.mapbox.com";
NSString *const MGLEventTypeMapLoad = @"map.load";
NSString *const MGLEventTypeMapTap = @"map.click";
@@ -230,6 +230,12 @@ const NSTimeInterval MGLFlushInterval = 60;
// Configure Events Infrastructure
// ===============================
// Check for TEST Metrics URL
NSString *testURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLMetricsTestServerURL"];
if (testURL != nil) {
MGLMapboxEventsAPIBase = testURL;
}
_paused = YES;
[self resumeMetricsCollection];
NSBundle *resourceBundle = [NSBundle bundleWithPath:[NSBundle mgl_resourceBundlePath]];