Creating a boolean flag
In order to create a boolean flag, you need two things:
-
A container class for your flags
-
A defined flag inside the container class
Creating a container class and defining a feature flag
In the examples below, a container class is defined along with a Boolean flag. The flag name, videoChat, is derived from the flag variable name. This flag is false by default.
Swift | Objective-c | Android | React Native | JavaScript | Node.js | JavaScript SSR | JVM | Kotlin | .NET | Python | Go | Ruby | PHP | C | C++ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Registering the container class
Once you have the container class, you need to register its instance to
the CloudBees Feature Management SDK. This is done with the Rox.register()
SDK function.
The namespace parameter is a logical separation between containers, and can be used to find flags on the dashboard.
Important notes
|
In the examples below, the Rox.register()
SDK function is called to
register the class instance:
Swift | Objective-C | Android | React Native | JavaScript | Node.js | JavaScript SSR | JVM | .NET | Python | Go | Ruby | PHP | C | C++ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Using the flag
The last two things you need to do in the SDK is to use the flag. You can use the flag by checking the value of the flag.
The examples below show how the flag is used:
Swift | Objective-C | Android | React Native | JavaScript | Node.js | JavaScript SSR | JVM | .NET | Python | Go | Ruby | PHP | C | C++ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Default flag values
A boolean flag is false by default. To override the value, pass the desired value to the flag.
Flag freeze level Flag freeze is available on client side SDKs by default.
See Understanding a flag freeze for more information. |