Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to modify main bundle of iOS app?
    text
    copied!<p>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.</p> <p>I've prepared two build targets for my app to support this separation, as described <a href="https://stackoverflow.com/questions/792170/iphone-xcode-can-different-project-targets-have-different-bundle-identifiers">here</a>. These targets differs in Bundle ID.</p> <p>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.</p> <p>Is it possible to change the main bundle ID after downloading the free app to get an unauthorized access to paid version? I found <a href="https://stackoverflow.com/questions/5976846/modify-the-value-in-settings-bundle-in-iphone">here</a>, <a href="https://stackoverflow.com/questions/5045937/objective-c-write-a-file-programmatically-to-the-main-bundle">here</a> and <a href="https://stackoverflow.com/questions/5854795/is-it-possible-to-write-new-file-to-bundle-resource-directory-in-ios-app">here</a> that it isn't. </p> <p>But... what about <em>jailbroken</em> phones? I've read in some comments, it is.</p> <p>If so, how can I <em>protect</em> my app?</p> <p>I was also thinking about defining preprocessor directive like <code>#define FREE_APP</code>. Then I'd check:</p> <pre><code>#ifdef FREE_APP //show ads #endif </code></pre> <p>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.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload