Merge pull request #1611 from friedbunny/1519-actionsheet-metrics-squash
[squash] Add action sheet shortcut to Settings.app metrics opt-out
This commit is contained in:
@@ -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 -
|
||||
|
||||
Reference in New Issue
Block a user