I want to provide two versions of my iOS app: paid and free with ads. My goal is to keep the code base the same and change only a flag to indicate which version I want to build.
I've prepared two build targets for my app to support this separation, as described here. These targets differs in Bundle ID.
Now, I'd like to change the flag based on given Bundle ID. I've tried to read main bundle identifier and it worked perfectly. And here my question starts.
Is it possible to change the main bundle ID after downloading the free app to get an unauthorized access to paid version? I found here, here and here that it isn't.
But... what about jailbroken phones? I've read in some comments, it is.
If so, how can I protect my app?
I was also thinking about defining preprocessor directive like #define FREE_APP
. Then I'd check:
#ifdef FREE_APP
//show ads
#endif
But this solution can't be totally automatized just by selecting build - I'd still need to change this value manually - so it isn't the best. Will be grateful for suggestions.