I've three API
with different API Keys
and some different settings
For development or internal testing build - Development distribution outside the iOS App Store
Host
- devapi.project-name.comAPI Key
- development_keyFLEX
[1] - Enable
For client testing build - Enterprise distribution outside the iOS App Store
Host
- stgapi.project-name.comAPI Key
- enterprise_keyFLEX
- Enable
For production build - Distribution in the iOS App Store
Host
- API.project-name.comAPI key
- app_store_keyFLEX
- Disable
I'm able to manage two setting by using DEBUG
#if DEBUG
#define API_BASE_URL @"http://devapi.project-name.com/api/v1"
#define API_KEY @"development_key"
#else
#define API_BASE_URL @"http://stgapi.project-name.com/api/v1"
#define API_KEY @"enterprise_key"
#endif
// In AppDelegate.m
#if DEBUG
[[FLEXManager sharedManager] showExplorer];
#endif
But first problem is Enterprise distribution (for client testing) and iOS App Store distribution (production) build, for Enterprise and App Store distribution every time need to change code
For Enterprise distribution
#if DEBUG //debug setting #else //enterprise setting #define API_BASE_URL @"http://stgapi.project-name.com/api/v1" #define API_KEY @"enterprise_key" #endif
For App Store distribution
#if DEBUG //debug setting #else //app store setting #define API_BASE_URL @"http://api.project-name.com/api/v1" #define API_KEY @"app_store_key" #endif
I'm looking for way something like this
#ifdef DEVELOPMENT
#define API_BASE_URL @"http://devapi.project-name.com/api/v1"
#define API_KEY @"development_key"
#elif ENTERPRISE
#define API_BASE_URL @"http://stgapi.project-name.com/api/v1"
#define API_KEY @"enterprise_key"
#elif APP_STORE
#define API_BASE_URL @"http://api.project-name.com/api/v1"
#define API_KEY @"app_store_key"
#endif
Or any other?
Second Problem
Is there any way to create three build with different name without creating different target?
ProductName
- For App StoreProductName-Dev
- For Internal Development buildProductName-Stg
- For Client Testing (Enterprise) build
I've just created demo project and full visual guide based on solution give by iamnichols