diff options
Diffstat (limited to 'platform/ios/app/MBXAppDelegate.m')
-rw-r--r-- | platform/ios/app/MBXAppDelegate.m | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/ios/app/MBXAppDelegate.m b/platform/ios/app/MBXAppDelegate.m index 9932356e6e..6abee91557 100644 --- a/platform/ios/app/MBXAppDelegate.m +++ b/platform/ios/app/MBXAppDelegate.m @@ -4,6 +4,10 @@ NSString * const MBXMapboxAccessTokenDefaultsKey = @"MBXMapboxAccessToken"; +@interface MBXAppDelegate() <MGLMetricsManagerDelegate> + +@end + @implementation MBXAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions @@ -24,6 +28,7 @@ NSString * const MBXMapboxAccessTokenDefaultsKey = @"MBXMapboxAccessToken"; #ifndef MGL_DISABLE_LOGGING [MGLLoggingConfiguration sharedConfiguration].loggingLevel = MGLLoggingLevelFault; #endif + [MGLMetricsManager sharedManager].delegate = self; } return YES; @@ -47,4 +52,12 @@ NSString * const MBXMapboxAccessTokenDefaultsKey = @"MBXMapboxAccessToken"; 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 |