#1134 - Removing enabled.email metric and supporting infrastructure

This commit is contained in:
Brad Leege
2015-03-27 19:25:59 -05:00
parent 5c6809fc36
commit a325cb98b5
3 changed files with 1 additions and 29 deletions

View File

@@ -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.

View File

@@ -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;

View File

@@ -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 {