Files
MapLibreParticleLab/platform/ios/app/MBXAppDelegate.m
mwilsnd 20d9e1028c Platform flattening overhaul (#1393)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
2023-07-26 17:50:34 +02:00

45 lines
1.2 KiB
Objective-C

#import "Mapbox.h"
#import "MBXAppDelegate.h"
#import "MBXViewController.h"
@interface MBXAppDelegate()
@end
@implementation MBXAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#ifndef MLN_DISABLE_LOGGING
[MLNLoggingConfiguration sharedConfiguration].loggingLevel = MLNLoggingLevelFault;
#endif
[MLNSettings useWellKnownTileServer:MLNMapTiler];
return YES;
}
// 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] options:@{} completionHandler:^(BOOL success) {
if (success) {
NSLog(@"Opened url");
}
}];
});
return YES;
}
return NO;
}
@end