I need to detect at run time whether my apps copy is Production/Development version. Is there any methods to achieve the same.
I am looking forward to develop push notification API which will send APNS messages to server accordingly(i.e. sandbox or without sandbox).
Any help? thanx in advance.
In that case you can use conditional compiling and check if you are in debug mode.
In your project settings you should have defined a preprocessor macro to indicate the debug build:
you can use that or define your own.
in your code you can put:
NSString* platform = @"ios";
#if DEBUG
platform = @"ios_sandbox";
#endif
everything between #if DEBUG
and #endif
will only be compiled when DEBUG=1
is defined (in this case only in debug configuration) so at the end you will have in platform
variable the value of ios
in release builds and ios_sandbox
in debug builds.
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