I'm creating a .framework (or a static library) for a component that I developed and that I'd like to sell to third-parties.
I was planning to add some code to protect the framework from unauthorised re-use, re-distribution or re-sale.
I think a good way to achieve this would be to ask to the purchaser to tell me what is the bundle ID of the app that will use the framework, save it in the framework as an NSString property and create a method that checks at runtime if the bundle ID of the app that is using the framework match or not.
However I'd like also to make the framework available to try for free. Therefore I want to enable the bundle ID check only then the containing app is compiled in released mode, or when the app is running on the end user device, outside the development sandbox.
Of course I can't use any methods that relies on variables or macros set in the project file, because they would be too easy to exploit. I need to do it at runtime... and without any action needed by the purchaser.
Is there a way to check at runtime if an app is running in the developer sandbox or not? Or if an app has been built with the release build profile?
Thanks!