CloudBees Feature Management is an advanced feature flagging solution that lets your development teams quickly build and deploy applications without compromising on safety.
Features
-
Mobile-first: CloudBees Feature Management is the first feature flagging system built from the ground up to run directly inside phones, tablets, and wearables.
-
Simple: CloudBees Feature Management allows developers to focus on their business logic instead of the complex configurations on the dashboard.
-
Modern: Using static types, the compiler and IDE are responsible for preventing collisions, allowing easy flags discovery by developers (through autocomplete).
-
Support Optimizations: CloudBees Feature Management unique proposition is that it supports the company’s needs for a fully capable experimentation system, for A/B/N testing, optimizations, customizations, and more.
ROX
public class ROX
ROX class is a static swift class that acts as a facade interface.
You can use this flag for the following:
-
Initialize CloudBees Feature Management SDK using
ROX.setup(withKey:)
. -
Register container instances using
ROX.register(_:)
. -
Load custom properties with
ROX.setCustomProperty(key:value:)
. -
Present the flags view controller with
ROX.flagsViewController()
.
Methods | Description | Declaration | Parameter | ||
---|---|---|---|---|---|
setup(withKey:) |
|
|
| ||
setup(withKey:options:) |
|
|
| ||
shutdown() |
|
| |||
register(_:) | Register a container instance to CloudBees Feature Management system.
|
|
| ||
unfreeze() | Unfreeze the state of all flags in code When a flag is used in code, its value gets frozen in the app until the next app foreground event. Calling this function will unfreeze all flags, and using a flag will return its most updated value. |
| |||
flagsViewController() |
|
| Return Value ViewController which shows the local feature flags and provides an interface to turn them on or off. | ||
setCustomProperty(key:value:) | Sets a custom property value that can be used when creating target groups. |
|
| ||
setCustomProperty(key:asSemver:value:) | Sets a custom property value that can be used when creating target groups. |
|
| ||
setCustomProperty(key:value:) |
|
|
| ||
setCustomProperty(key:asSemver:value:) |
|
|
| ||
setCustomProperty(key:value:) | Sets a custom property value that can be used when creating target groups. |
|
| ||
setCustomProperty(key:value:) |
|
|
value::a code block to return the value of the custom property | ||
setCustomProperty(key:value:) | Sets a custom property value that can be used when creating target groups. |
|
| ||
setCustomProperty(key:value:) |
|
|
value::a code block to return the value of the custom property | ||
setCustomProperty(key:value:) | Sets a computed custom property value that can be used when creating target groups. |
|
| ||
setCustomProperty(key:value:) | Sets a computed custom property value that can be used when creating target groups. |
|
| ||
setGlobalContext(context:) | Set a global context. This context will be available to all flags evaluations (in addition to the specific call context). |
|
| ||
dynamicAPI() | An alternative of using container with register. This allows you to evaluate flags without having a static container. DynamicApi will create flags as if they were registered, including sending them to the dashboard. See also Dynamic api. |
|
Protocols
Protocols | Description |
---|---|
RoxContainer | A container class for configurations and flags. Any Swift class that adopts this protocol can be used as an entry point for flags and containers that are controlled by the CloudBees Feature Management system. To use an instance of this class you need to register the instance using the ROX.register(:) method and retrieve the instance using ROX.get(:) method. |
- Here is an example of a class using flags and containers together
public class MyContainer : RoxContainer {
//group support feature flag
let groupSupport = RoxFlag()
// String flag defaulted to "Hello World"
let message = RoxString(withDefault: "Hello World")
// Bool flag default to true
let shouldShowBadge = RoxFlag(withDefault: true)
// Int configuration default to 100
let popupTimeout = RoxInt(withDefault: 100)
// Double configuration default to
let ratio = RoxDouble(withDefault: 0.55)
}
let conf = MyContainer()
// Register MyContainer class
ROX.register(conf)
// Use the Flag
conf.groupSupport.enabled {
print("group support enable code goes here")
}
print("Welcome message is '\(conf.message.value)'")
RoxString
This class is the API for string feature flags that are controlled by ROX server.
open class RoxString {
open var name: String! { get }
open var value: String! { get }
}
RoxFlag
This class is the API for bool feature flags that are controlled by CloudBees Feature Management server.
open class RoxFlag : RoxString {
open var isEnabled: Bool { get }
open func enabled(_ codeBlock: (() -> Swift.Void)!)
open func disabled(_ codeBlock: (() -> Swift.Void)!)
open func enabled(_ enabledCodeBlock: (() -> Swift.Void)!, disabled disabledCodeBlock: (() -> Swift.Void)!)
open var name: String! { get }
}