From a325cb98b5cae0fb145a09f2c739d3161e7f861d Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Fri, 27 Mar 2015 19:25:59 -0500 Subject: [PATCH] #1134 - Removing enabled.email metric and supporting infrastructure --- include/mbgl/ios/MGLMapboxEvents.h | 1 - platform/ios/MGLMapView.mm | 3 +-- platform/ios/MGLMapboxEvents.m | 26 -------------------------- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/include/mbgl/ios/MGLMapboxEvents.h b/include/mbgl/ios/MGLMapboxEvents.h index 0567eb676..ea37edbb8 100644 --- a/include/mbgl/ios/MGLMapboxEvents.h +++ b/include/mbgl/ios/MGLMapboxEvents.h @@ -41,7 +41,6 @@ extern NSString *const MGLEventGestureRotateStart; // You can call these methods from any thread. // -+ (BOOL) checkEmailEnabled; + (BOOL) checkPushEnabled; // You can call this method from any thread. diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 200fb02fa..7c997d615 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -359,8 +359,7 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr; MGLEventKeyLatitude: @(latLng.latitude), MGLEventKeyLongitude: @(latLng.longitude), MGLEventKeyZoomLevel: @(zoom), - MGLEventKeyPushEnabled: @([MGLMapboxEvents checkPushEnabled]), - MGLEventKeyEmailEnabled: @([MGLMapboxEvents checkEmailEnabled]) + MGLEventKeyPushEnabled: @([MGLMapboxEvents checkPushEnabled]) }]; return YES; diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 547893602..ce5981537 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -548,32 +548,6 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; } } -// Can be called from any thread. -// -+ (BOOL) checkEmailEnabled { - BOOL (^mailCheckBlock)(void) = ^{ - BOOL blockResult; - Class MFMailComposeViewController = NSClassFromString(@"MFMailComposeViewController"); - if (MFMailComposeViewController) { - SEL canSendMail = NSSelectorFromString(@"canSendMail"); - blockResult = ((BOOL (*)(id, SEL))[MFMailComposeViewController methodForSelector:canSendMail])(MFMailComposeViewController, canSendMail); - } - return blockResult; - }; - - __block BOOL result; - - if ( ! [[NSThread currentThread] isMainThread]) { - dispatch_sync(dispatch_get_main_queue(), ^{ - result = mailCheckBlock(); - }); - } else { - result = mailCheckBlock(); - } - - return result; -} - // Can be called from any thread. // + (BOOL) checkPushEnabled {