The following information is for the latest SDK version (6.x). The CloudBees platform requires that your installed SDK version be at least 6.x. Please install the latest SDK by following the instructions in the platform UI or in the SDK installation documentation. Any updates to version 6.x are noted in the platform changelog. |
The following classes are available:
ROXBaseContainer
@interface ROXBaseContainer : NSObject
A container class for flag configurations.
Use any class that inherits from this base class as an entry point for flags and configurations that are controlled by the CloudBees platform. To use an instance of this class, register the instance using the [ROXCore register:]` method and retrieve the instance using the `[ROXCore get:]
method.
Method | Description | Declaration |
---|---|---|
-namespace |
Override this property to override the default namespace of a class. |
|
ROXCore
ROXCore class is a static class that acts as a facade interface.
Use this flag to:
-
Initialize the CloudBees platform SDK using
+setupWithKey:
. -
Register container instances using
+register:
. -
Retrieve container instances using
+getContainer:
. -
Load custom properties with
setCustomPropertyKey:value:
methods. -
Present the flags view controller with
+flagsViewController
.
Method | Description | Declaration | Parameters | ||
---|---|---|---|---|---|
setupWithKey: |
Loads the SDK, usually called as part of |
|
roxKey The platform environment-specific SDK key |
||
setupWithKey:options: |
Loads the SDK, usually called as part of |
|
|
||
shutdown |
Allows for the graceful shutdown of the You can call |
|
|||
register |
Registers a container instance to the CloudBees platform. @params container The instance to register.
Values are set at |
|
|
||
|
Unfreezes the state of all coded flags. Because the value of a flag is frozen until the next foreground event, you can call this function to unfreeze all flags. After unfreezing, using a flag returns its most updated value. If a namespace version is used, flags are only unfrozen within the given namespace. |
|
|||
flagsViewController |
A view to control feature flag values locally on a mobile device or simulator. ViewController allows developers or others (depending on policy) to view, enable, disable, and reset the state of their flags locally on the device. The function returns a view controller that can be loaded to the view hierarchy for test devices upon shake, or by triggering an existing debug view in the app. |
|
|||
setCustomStringProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setCustomComputedStringProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setCustomBooleanProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setCustomComputedBooleanProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setCustomIntProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setCustomComputedIntProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setCustomDoubleProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setCustomComputedDoubleProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setCustomSemverProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setCustomComputedSemverProperty:forKey: |
Sets a custom property value for use when creating target groups. |
|
|
||
setGlobalDynamicPropertyContext |
Sets a global context that is available to all flag evaluations (in addition to the specific call context). |
|
|
||
setUserspaceUnhandledErrorHandler |
A handler for all user function errors, to assist in debugging. If this function is not set, errors are logged to the logger.
|
|
|
||
overrides |
Use ROXFlagsOverrides to override a flag value locally. Use only in dev mode, not in production builds. |
|
|||
dynamicAPI |
An alternative to using container with register. This allows you to evaluate flags without having a static container. DynamicApi creates flags as if they were registered, including sending them to the UI. |
|
ROXFlag
@interface ROXFlag : ROXString
ROXFlag
is a feature flag object that accepts either a true or false value (a Boolean type).
Method | Description | Declaration | Parameters |
---|---|---|---|
isEnabled |
A property indicating if the flag is enabled or disabled. |
|
|
enabled |
Runs block if a flag is enabled. |
|
|
disabled |
Runs block if flag is disabled. |
|
|
enabled:disabled: |
Runs one of the given blocks based on flag status. |
|
|
forceValue |
Forces a value on the flag.
This overrides any other value, and can only be overridden with another call to |
|
|
initWithDefault |
Initializes a flag with a default Boolean value. |
|
|
ROXString
@interface ROXString : NSObject
ROXString
is a feature flag object that accepts a list of possible string values and a default value.
Use this list when selecting new values for the feature, and you can override the value via the UI.
Method | Description | Declaration | Parameters |
---|---|---|---|
value |
Returns the ROXString value considering the given context. |
|
|
defaultValue |
Returns the ROXString default value. |
|
|
name |
Returns the feature flag name. |
|
|
variations |
Returns the feature flag variations. |
|
|
unfreeze |
Unlocks the flag value from changes from the last time it was frozen. |
|
|
peek |
Returns the current flag value. Will not trigger a freeze or an impression. If the flag is frozen, the frozen value is returned. |
|
ROXInt
@interface ROXInt : ROXString
ROXInt
is a feature flag object that accepts a list of possible integer values and a default value.
Use this list when selecting new values for the feature, and you can override the value via the UI.
Method | Description | Declaration | Parameters |
---|---|---|---|
value |
Returns the ROXInt value considering the given context. |
|
|
initWithDefault |
Initializes a new ROXInt with a default value, variations and a possible freeze level. |
|
ROXDouble
@interface ROXDouble : ROXString
ROXDouble
is a feature flag object that accepts a list of possible double values and a default value.
Use this list when selecting new values for the feature, and you can override the value via the UI.
Method | Description | Declaration | Parameters |
---|---|---|---|
value |
Returns the ROXDouble value considering the given context. |
|
|
initWithDefault |
Initializes a new ROXDouble with a default value, variations and a possible freeze level. |
|
ROXOptions
@interface ROXOptions : NSObject
Use this configuration class when running +[ROXCore setupWithKey:options:].
Method | Description | Declaration | Parameters |
---|---|---|---|
syncCompletionHandler |
The completion handler that is called when the SDK has synced and applied the configuration. |
|
|
verbose |
Sets the SDK verbosity level for debugging. |
|
|
disableCrashReporting |
Set this option to |
|
|
dynamicPropertiesRule |
Calls the dynamic custom property generator when an explicit custom property definition does not exist on the client side. If you do not set the |
|
ROXDynamicAPI
@interface ROXDynamicAPI : NSObject
An alternative to using container with register. This allows you to evaluate flags without having a static container. DynamicApi creates flags as if they were registered, including sending them to the UI.
Method | Description | Declaration | Parameters |
---|---|---|---|
isEnabled |
Evaluate a a Boolean flag. |
|
|
getValue |
Evaluates a string flag. |
|
|
getInt |
Evaluates an integer flag. |
|
|
getDouble |
Evaluates a double flag. |
|
|
ROXReportingValue
@interface ROXReportingValue : NSObject
This class contains data about configured flag values.
Method | Description | Declaration | Parameters |
---|---|---|---|
name |
Name of the reporting |
|
|
value |
Value of the reporting |
|
ROXTargetGroup
@interface ROXTargetGroup : NSObject
This class contains session data about a target group.
Method | Description | Declaration |
---|---|---|
Name |
The target group name. |
|
isEnabled |
Whether a device is part of this target group. |
|
ROXOptionsVerboseLevel
enum ROXOptionsVerboseLevel {}
The enum to define the SDK verbosity level.
Method | Description | Declaration |
---|---|---|
ROXOptionsVerboseLevelSilent |
Silent logging. |
|
ROXOptionsVerboseLevelDebug |
Verbose logging. |
|
Type definitions
The following type definitions are available globally.
Method | Description | Declaration |
---|---|---|
ROXDynamicPropertyContext |
A function that retrieves a custom property value by the given key. |
|
ROXDynamicPropertiesRule |
A function that applies custom logic to a custom property evaluation. |
|
ROXUserspaceUnhandledErrorHandler |
A function that handles an exception raised within other user-defined handlers. |
|
ROXExceptionTrigger |
An indicator of the exception source. |
|