#1033 - Setting up Opt Out UI in Settings.app. Checking for Opt Out status at event push time.

This commit is contained in:
Brad Leege
2015-03-24 10:50:26 -05:00
parent 5acf518ea6
commit 25381187be
2 changed files with 33 additions and 64 deletions

View File

@@ -1,61 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Title</key>
<string>Group</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>AutocapitalizationType</key>
<string>None</string>
<key>AutocorrectionType</key>
<string>No</string>
<key>DefaultValue</key>
<string></string>
<key>IsSecure</key>
<false/>
<key>Key</key>
<string>name_preference</string>
<key>KeyboardType</key>
<string>Alphabet</string>
<key>Title</key>
<string>Name</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>enabled_preference</string>
<key>Title</key>
<string>Enabled</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<real>0.5</real>
<key>Key</key>
<string>slider_preference</string>
<key>MaximumValue</key>
<integer>1</integer>
<key>MaximumValueImage</key>
<string></string>
<key>MinimumValue</key>
<integer>0</integer>
<key>MinimumValueImage</key>
<string></string>
<key>Type</key>
<string>PSSliderSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Root</string>
</dict>
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Title</key>
<string>Privacy Settings</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>mapbox_metrics_enabled_preference</string>
<key>Title</key>
<string>Mapbox Metrics</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>TrueValue</key>
<true/>
<key>FalseValue</key>
<false/>
</dict>
</array>
<key>StringsTable</key>
<string>Root</string>
</dict>
</plist>

View File

@@ -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