diff options
Diffstat (limited to 'platform/ios/app/MBXAppDelegate.m')
-rw-r--r-- | platform/ios/app/MBXAppDelegate.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/platform/ios/app/MBXAppDelegate.m b/platform/ios/app/MBXAppDelegate.m index c2834bfa7f..1934f4912b 100644 --- a/platform/ios/app/MBXAppDelegate.m +++ b/platform/ios/app/MBXAppDelegate.m @@ -26,4 +26,22 @@ NSString * const MBXMapboxAccessTokenDefaultsKey = @"MBXMapboxAccessToken"; return YES; } +#pragma mark - Quick actions + +- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler { + completionHandler([self handleShortcut:shortcutItem]); +} + +- (BOOL)handleShortcut:(UIApplicationShortcutItem *)shortcut { + if ([[shortcut.type componentsSeparatedByString:@"."].lastObject isEqual:@"settings"]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]]; + }); + + return YES; + } + + return NO; +} + @end |