#1134 - Removing enabled.email metric and supporting infrastructure
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user