Programmatically distinguish between Ad-hoc and AppStore versions

I have an application that sends Keen IO logs for logging and analysis. The code that sends logs to Keen IO is protected by preprocessor macros and therefore never sends any logs when Im runs it on a simulator or my own phone during development.

I usually follow this: after the application is executed (almost), I release a special version and pass it on to some testers who use it for several days and test it. However, since it is also a release version, the application sends analytical data. This data usually pollutes my other data, which should have come from my real users!

I want to programmatically find out inside the application if it is an ad-hoc release version or an AppStore release version, so I can deal with these two conditions. Is there any way to do this?

The only way I can think of is through another preprocessor macro AD_HOCthat reports its test version. But it may happen that I forgot to delete the macro when sending to the AppStore. This will not help if this happens.

+4
source share
1 answer

. adhoc , , . , #define .

+2

All Articles