diff --git a/ios/app/Settings.bundle/Root.plist b/ios/app/Settings.bundle/Root.plist index fa9830605..513836e92 100644 --- a/ios/app/Settings.bundle/Root.plist +++ b/ios/app/Settings.bundle/Root.plist @@ -1,61 +1,31 @@ - - PreferenceSpecifiers - - - Title - Group - Type - PSGroupSpecifier - - - AutocapitalizationType - None - AutocorrectionType - No - DefaultValue - - IsSecure - - Key - name_preference - KeyboardType - Alphabet - Title - Name - Type - PSTextFieldSpecifier - - - DefaultValue - - Key - enabled_preference - Title - Enabled - Type - PSToggleSwitchSpecifier - - - DefaultValue - 0.5 - Key - slider_preference - MaximumValue - 1 - MaximumValueImage - - MinimumValue - 0 - MinimumValueImage - - Type - PSSliderSpecifier - - - StringsTable - Root - + + PreferenceSpecifiers + + + Title + Privacy Settings + Type + PSGroupSpecifier + + + DefaultValue + + Key + mapbox_metrics_enabled_preference + Title + Mapbox Metrics + Type + PSToggleSwitchSpecifier + TrueValue + + FalseValue + + + + StringsTable + Root + diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 3178a460d..11303bc0e 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -116,13 +116,12 @@ NSNumber *scale; - (void) pushEvent:(NSString *)event withAttributes:(NSDictionary *)attributeDictionary { - // TODO Add Opt Out Checking When Built - /** - if (![[NSUserDefaults standardUserDefaults] boolForKey:@"mapbox_metrics_enabled_preference"]) { - NSLog(@"Mapbox Metrics are not enabled, so return without sending in data."); - return; - } - */ + // 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; + } // TODO - Add Metrics Disabled App Wide Check