Question

I have an app that sends logs to Keen IO for logging and analysis purposes. The code that sends logs to Keen IO is guarded by preprocessor macros, and hence it never sends any logs when I’m running it on the simulator or my own phone while development.

What I generally follow is this — After the app is (almost) done, I release an ad-hoc version and give it to some testers who use it for a few days and test it. However, since it is also a “release” version, the app sends analysis data. This data usually pollutes my other data that was supposed to come from my real users!

I want to programmatically know inside the app if it is an ad-hoc release version or AppStore release version, so I can handle those two conditions. Is there a way to do this?

The only way I can think of is have another preprocessor macro AD_HOC that tells that its a test version. But it can happen that I forget to remove the macro while submitting to the AppStore. Its not gonna help if that happens.

Was it helpful?

Solution

I use such a macro for a very similar reason. I build the adhoc version using the release building setting and the app store version using the distribution build setting. In that way I avoid forgetting to set the #define to the right value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top