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 {