Removing logging from development / testing phase. Removing Settings bundle work from MGLMetricsLocationManager as it's handled in MGLMapboxEvents.

This commit is contained in:
Brad Leege
2015-03-24 19:34:27 -05:00
parent 3490622dd2
commit 033f83b1a8
2 changed files with 0 additions and 25 deletions

View File

@@ -118,14 +118,12 @@ NSNumber *scale;
// Opt Out Checking When Built
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"mapbox_metrics_enabled_preference"]) {
NSLog(@"Mapbox Metrics are not enabled, so clear any currently stored events, and return without sending in data.");
[_queue removeAllObjects];
return;
}
// Add Metrics Disabled App Wide Check
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"mapbox_metrics_disabled"] != nil) {
NSLog(@"Mapbox Metrics have been disabled for this app.");
[_queue removeAllObjects];
return;
}
@@ -174,7 +172,6 @@ NSNumber *scale;
- (void) flush {
if (_token == nil) {
NSLog(@"token hasn't been set yet, so no events can be sent. return");
return;
}

View File

@@ -25,24 +25,6 @@ static MGLMetricsLocationManager *sharedManager = nil;
- (id) init {
if (self = [super init]) {
NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
if(!settingsBundle) {
NSLog(@"Could not find Settings.bundle");
} else {
NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]];
NSArray *preferences = [settings objectForKey:@"PreferenceSpecifiers"];
NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:[preferences count]];
for(NSDictionary *prefSpecification in preferences) {
NSString *key = [prefSpecification objectForKey:@"Key"];
if(key && [[prefSpecification allKeys] containsObject:@"DefaultValue"]) {
[defaultsToRegister setObject:[prefSpecification objectForKey:@"DefaultValue"] forKey:key];
}
}
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsToRegister];
}
_locationManager = [[CLLocationManager alloc] init];
_locationManager.distanceFilter = 2;
_locationManager.desiredAccuracy = kCLLocationAccuracyBest;
@@ -83,9 +65,6 @@ static MGLMetricsLocationManager *sharedManager = nil;
#pragma mark CLLocationManagerDelegate
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
CLLocation *loc = (CLLocation *)[locations objectAtIndex:0];
NSLog(@"didUpdateLocations() called with %lu location in array. First Location = %f, %f", (unsigned long)locations.count, loc.coordinate.latitude, loc.coordinate.longitude);
// Iterate through locations to pass all data
for (CLLocation *loc in locations) {
NSMutableDictionary *evt = [[NSMutableDictionary alloc] init];
@@ -123,7 +102,6 @@ static MGLMetricsLocationManager *sharedManager = nil;
newStatus = @"Unknown";
break;
}
NSLog(@"MGLMetricsLocationManager didChangeAuthorizationStatus() called. New Status = %@", newStatus);
}
@end