Implementing Testflight.com and Flurry.com Exception Handling

We use both testflight.com sdk and flurry.com sdk to track unhandled exceptions. The problem is that no exceptions are caught in the flurry after we added testflight.com sdk.

The method initiated when an unhandled exception occurs is as follows:

void uncaughtExceptionHandler(NSException *exception) { [FlurryAnalytics logError:@"ERROR_NAME" message:@"ERROR_MESSAGE" exception:exception]; } - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { #if !TARGET_IPHONE_SIMULATOR NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler); struct sigaction newSignalAction; memset(&newSignalAction, 0, sizeof(newSignalAction)); newSignalAction.sa_handler = &signalHandler; sigaction(SIGABRT, &newSignalAction, NULL); sigaction(SIGILL, &newSignalAction, NULL); sigaction(SIGBUS, &newSignalAction, NULL); [FlurryAnalytics startSession:kFlurryKey]; [TestFlight takeOff:kTestflightKey]; [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; [UIApplication sharedApplication].applicationIconBadgeNumber = 0; #endif . . . 

I'm not sure how testflight.com does it, but it looks like they catch an exception and log data for themselves, preventing the registered method from working?

Is there any way for both of them to coexist?

+7
source share
3 answers

I received confirmation from the Testflightapp.com team that this is a known issue. They hope to fix in the next version of which they spoke.

+4
source

I can't verify this directly, but the TestFlight documentation seems to say the following:

If you use uncaught exceptions or signal handlers, set handlers before calling the takeOff method. Then our SDK will call your handler while we work.

They even provide some sample code that can help you with this.

0
source

I found a solution on the blog, not sure if it works for Flurry either, that it says to call the UninstallCrashHandlers method (declared in TestFlight.h) twice after the [TestFlight takeOff: @ "KEY] method and then register another service for which you want to use for crash reporting.See sample code for TestFlight vs Crashlytics

Turning off TestFlights crash reporting is pretty simple. Add the following code that you included in AppDelegate.m:

 ... #import TestFlight.h // Function prototype for UninstallCrashHandler extern void UninstallCrashHandlers(BOOL restore); 

In didFinishLaunchingWithOptions, first call this method with NO and then with YES, for example:

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [TestFlight takeOff:@"<TestFlightKey>"]; UninstallCrashHandlers(NO); UninstallCrashHandlers(YES); [Crashlytics startWithAPIKey:@"<CrashlyticsKey>"]; return YES; } 

ref: http://www.grahamdennis.me/blog/2012/10/21/how-to-disable-testflights-crash-handlers/

0
source

All Articles