Removing logging from development / testing phase. Removing Settings bundle work from MGLMetricsLocationManager as it's handled in MGLMapboxEvents.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user