Files
MapLibreParticleLab/platform/ios/app/MBXAppDelegate.m
Nadia Barbosa 3e4afbc788 [iosapp] Move token setting to build script
[ios] Switch to script-based token insertion for benchmarking app

[ios] Update Developing.md

[iosapp, benchmark app] Look for token file outside of version-controlled directory

[iosapp, benchmark app] Remove remaining code for access token checking from app delegates

Feedback edits for @friedbunny
2019-05-01 18:30:46 -07:00

48 lines
1.5 KiB
Objective-C

#import "MBXAppDelegate.h"
#import "MBXViewController.h"
#import <Mapbox/Mapbox.h>
@interface MBXAppDelegate() <MGLMetricsManagerDelegate>
@end
@implementation MBXAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#ifndef MGL_DISABLE_LOGGING
[MGLLoggingConfiguration sharedConfiguration].loggingLevel = MGLLoggingLevelFault;
#endif
[MGLMetricsManager sharedManager].delegate = self;
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;
}
- (BOOL)metricsManager:(MGLMetricsManager *)metricsManager shouldHandleMetric:(MGLMetricType)metricType {
return YES;
}
- (void)metricsManager:(MGLMetricsManager *)metricsManager didCollectMetric:(MGLMetricType)metricType withAttributes:(NSDictionary *)attributes {
[[MGLMetricsManager sharedManager] pushMetric:metricType withAttributes:attributes];
}
@end