Question

I use TestFlight for crash reporting and logging check points for testing in development. But for live app, I want to use crash reporting only.

To disable check points I can use preprocessor macro.e.g.

#ifdef TESTFLIGHT
    [TestFlight passCheckpoint:@"Some event occurred"];
#endif

But problem with this approach is that I need to use this condition every time I send check point to TestFlight. I have around 70 check points.

I am looking for a way where I need to configure at one or two places in project and don't need to care about adding if condition for each new check point I add to project.

Please note that I do want to use TestFlight for crash reporting so I cannot completely disable TestFlight.

Was it helpful?

Solution

In some common header:

#ifdef TESTFLIGHT
#define TF_PASSCHECKPOINT(s) [TestFlight passCheckpoint:(s)];
#else
#define TF_PASSCHECKPOINT(s)
#endif

Then just say:

- (void)someFunction {
    TF_PASSCHECKPOINT(@"entered someFunction");
    ...
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top