Feature Flag Setup

A Feature Flag is a statement in your code that specifies how the app should behave when the flag is “on” or “off”. This logic can be used multiple times in your code.

iOS
if ([Apptimize isFeatureFlagOn:@"new_feature_flag_variable"]) {
   // ON
} else {
   // OFF
}
Android
if (Apptimize.isFeatureFlagOn("new_feature_flag_variable")) {
   // ON
} else {
   // OFF
}

The variable name used (new_feature_flag_variable in the example above) should match the variable name within “Create Code” of your feature flag. This links the Feature Flag in the Apptimize dashboard to your app’s code.

../_images/Create-Feature-Flag.png