We're using separate databases for production and development for our iOS application, and we're testing via TestFlight. The problem is TestFlight distributing the application in release mode.
How can I configure the project so that it distributes the application in development mode?
Or should I actually set different build identifiers for release and development and then have two applications in TestFlight?
What's normally being done?
Summary of solution
I suggest you to add a value in build settings. You set it to PRODUCTION
only when you build your production version.
Just use an #if
statement to check if the PRODUCTION
is set
In my app (I use Batch for push notifications)
I have 2 versions of the same app. one free with ads, one paid without ads. I just set like this in the free version:
And like this in the paid version:
And finally I use it in code =]
// MARK: Batch.
#if FREE
#if DEBUG
print("Batch FREE - DEBUG mode")
Batch.start(withAPIKey: "-MY FREE VERSION DEBUG KEY-") // dev
#elseif RELEASE
print("Batch FREE - RELEASE mode")
Batch.start(withAPIKey: "-MY FREE VERSION RELEASE KEY-") // live
#endif
#elseif PAID
#if DEBUG
print("Batch PAID - DEBUG mode")
Batch.start(withAPIKey: "-MY PAID VERSION DEBUG KEY-") // dev
#elseif RELEASE
print("Batch PAID - RELEASE mode")
Batch.start(withAPIKey: "-MY PAID VERSION RELEASE KEY-") // live
#endif
#endif
// Register for push notifications
BatchPush.registerForRemoteNotifications()
In your case it will be manual due.
You set PRODUCTION
in Active Compilation Conditions
only when building to production.
and then add this code:
#if PRODUCTION
// Connect to production database
#else
// Connect to test database
#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