diff options
author | Brad Leege <bleege@gmail.com> | 2015-03-24 10:50:26 -0500 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2015-03-24 10:50:26 -0500 |
commit | 25381187be68f9a170082aa732bb3df61af34baf (patch) | |
tree | 9484388c6617327a332d49e94179f13efbaed4e8 | |
parent | 5acf518ea6c7fe1c52e63922619ede5ba3f2404f (diff) | |
download | qtlocation-mapboxgl-25381187be68f9a170082aa732bb3df61af34baf.tar.gz |
#1033 - Setting up Opt Out UI in Settings.app. Checking for Opt Out status at event push time.
-rw-r--r-- | ios/app/Settings.bundle/Root.plist | 84 | ||||
-rw-r--r-- | platform/ios/MGLMapboxEvents.m | 13 |
2 files changed, 33 insertions, 64 deletions
diff --git a/ios/app/Settings.bundle/Root.plist b/ios/app/Settings.bundle/Root.plist index fa9830605b..513836e92f 100644 --- a/ios/app/Settings.bundle/Root.plist +++ b/ios/app/Settings.bundle/Root.plist @@ -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> diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 3178a460d4..11303bc0ec 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 |