summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Leege <bleege@gmail.com>2015-03-24 11:33:08 -0500
committerBrad Leege <bleege@gmail.com>2015-03-24 11:33:08 -0500
commit308d382bd28b0a03eb5bf427f9ff83316fea3c85 (patch)
treef7c9dd8842a18f581dd5dc74221753e5d7c072a2
parent25381187be68f9a170082aa732bb3df61af34baf (diff)
downloadqtlocation-mapboxgl-308d382bd28b0a03eb5bf427f9ff83316fea3c85.tar.gz
#1033 - Building Mapbox Metrics Disabled UI in Settings.app and functionality in Events tracking infrastructure
-rw-r--r--ios/app/Settings.bundle/Root.plist70
-rw-r--r--platform/ios/MGLMapboxEvents.m8
2 files changed, 49 insertions, 29 deletions
diff --git a/ios/app/Settings.bundle/Root.plist b/ios/app/Settings.bundle/Root.plist
index 513836e92f..e09c225913 100644
--- a/ios/app/Settings.bundle/Root.plist
+++ b/ios/app/Settings.bundle/Root.plist
@@ -1,31 +1,47 @@
<?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>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>
+<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_disabled</string>
+ <key>Title</key>
+ <string>Mapbox Metrics Are Disabled</string>
+ <key>Type</key>
+ <string>PSTitleValueSpecifier</string>
+ <key>TrueValue</key>
+ <true/>
+ <key>FalseValue</key>
+ <false/>
+ </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 11303bc0ec..a231b5115f 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) {