diff --git a/ios/app/Settings.bundle/Root.plist b/ios/app/Settings.bundle/Root.plist index 513836e92..e09c22591 100644 --- a/ios/app/Settings.bundle/Root.plist +++ b/ios/app/Settings.bundle/Root.plist @@ -1,31 +1,47 @@ - - PreferenceSpecifiers - - - Title - Privacy Settings - Type - PSGroupSpecifier - - - DefaultValue - - Key - mapbox_metrics_enabled_preference - Title - Mapbox Metrics - Type - PSToggleSwitchSpecifier - TrueValue - - FalseValue - - - - StringsTable - Root - + + PreferenceSpecifiers + + + Title + Privacy Settings + Type + PSGroupSpecifier + + + DefaultValue + + Key + mapbox_metrics_disabled + Title + Mapbox Metrics Are Disabled + Type + PSTitleValueSpecifier + TrueValue + + FalseValue + + + + + StringsTable + Root + diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 11303bc0e..a231b5115 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -123,7 +123,12 @@ NSNumber *scale; return; } - // TODO - Add Metrics Disabled App Wide Check + // 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; + } if (!event) { return; @@ -173,7 +178,6 @@ NSNumber *scale; return; } - int upper = (int)_flushAt; if (_flushAt > [_queue count]) { if ([_queue count] == 0) {