summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-05-21 01:55:17 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-05-21 01:55:17 -0700
commita91b1d73e2db0600372ae00ca9211aa03a89dca2 (patch)
tree74ad868c690de7148147acc3599480b0eb7fa596
parent8a83c31e05b47c910d5862cb2ed34828fc491e40 (diff)
parent911a8ffc603f4bf380b5f565dea5f0319a5d37b0 (diff)
downloadqtlocation-mapboxgl-a91b1d73e2db0600372ae00ca9211aa03a89dca2.tar.gz
Merge pull request #1611 from friedbunny/1519-actionsheet-metrics-squash
[squash] Add action sheet shortcut to Settings.app metrics opt-out
-rw-r--r--platform/ios/MGLMapView.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index 215be14b54..1fa6711d84 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -295,6 +295,12 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
@"Improve This Map",
nil];
+ // iOS 8+: add action that opens app's Settings.app panel, if applicable
+ if (&UIApplicationOpenSettingsURLString != NULL && ! [MGLAccountManager mapboxMetricsEnabledSettingShownInApp])
+ {
+ [_attributionSheet addButtonWithTitle:@"Adjust Privacy Settings"];
+ }
+
// setup compass
//
_compass = [[UIImageView alloc] initWithImage:[MGLMapView resourceImageNamed:@"Compass.png"]];
@@ -1272,6 +1278,11 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:feedbackURL]];
}
+ // skips to 4 because button is conditionally added after cancel (index 3)
+ else if (buttonIndex == actionSheet.firstOtherButtonIndex + 4)
+ {
+ [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+ }
}
#pragma mark - Properties -