Question about best practices.
Is there a way to programmatically detect whether the app is being compiled for an AdHoc configuration, and, if so, enable a feature in the app?
For example, I am thinking of enabling a switch between beta and prod environment given depending on whether the app is an an AdHoc vs. Release configuration.
This way we can give testers the ability to switch between server environments in the same app.
Could do this with a #define but thought I would ask if there is a more elegant way to do it by detecting the current configuration.
As indicated by the alert, to enable Developer Mode go to Settings > Privacy & Security on the iOS device. Scroll down to the Developer Mode list item and navigate into it. To toggle Developer mode, use the “Developer Mode” switch. Tap the switch to enable Developer Mode.
Try following things : Turn on/off Associated Domains in Xcode capabilities section. Create provisioning profile again. Go to developer.apple.com and check capabilities under your app id.
In the toolbar, click the Library button (+) to open the Capabilities library. Alternatively, click + Capability to the left of the build configurations, or choose Editor > Add Capability.
A build setting is a variable that contains information about how a particular aspect of a product's build process should be performed. For example, the information in a build setting can specify which options Xcode passes to the compiler. You can specify build settings at the project or target level.
You can set a custom define in your configuration using the Preprocessor Macros
setting in your project or target info. This works just as if you had #define
'd a variable in your source.
In your release configuration, set GCC_PREPROCESSOR_DEFINITIONS
("Preprocessor Macros") to MYAPP_RELEASE=1
. You can then use this code to change functionality at compile-time:
#ifdef MYAPP_RELEASE
NSString *title = @"Release Version";
#else
NSString *title = @"Beta Version";
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With