Mobile SDK reference

5 minute read

CloudBees Unify Feature Management SDKs for mobile platforms provide native integration for Android, iOS, and React Native applications. Use this reference when implementing feature flags in mobile applications or troubleshooting SDK integration issues.

Each reference covers SDK version 6.x. Refer to the CloudBees Unify changelog for version-specific differences.

Android SDK methods

The Android SDK provides the Rox class as the main interface for feature flag management in Android applications.

Rox class

package io.rollout.android; class Rox

The main SDK class for Android applications that provides setup, registration, and lifecycle management methods for feature flag integration.

Initialize the Android SDK (setup)

static void setup(Application app) static void setup(Application app, String appKey) static void setup(Application app, RoxOptions options) static void setup(Application application, String appKey, RoxOptions sdkOptions)

Configures the SDK to work with the provided Android application. Sets default verbosity level to VERBOSE_LEVEL_SILENT. Applies provided RoxOptions for logging verbosity and sync completion callbacks.

Parameter Type Description

app

Application

Android application object representing the feature-controlled app.

appKey

String

The application’s CloudBees Unify SDK key.

options

RoxOptions

Configuration instance with desired SDK settings.

Register flag containers (register)

static void register(String namespace, RoxContainer container)

Registers a container instance with CloudBees Unify to make flags available for configuration. Values are updated during sync operations or app foreground events.

Fetch latest configuration (fetch)

static Future<CoreState> fetch()

Retrieves the latest configuration from CloudBees Unify. Returns Future<CoreState> indicating success or failure.

iOS Swift SDK methods

The iOS Swift SDK provides the ROX class as the main interface for feature flag management in iOS applications using Swift.

ROX class

public class ROX

Static Swift class providing facade interface for SDK operations in iOS applications. Use for initializing the SDK, registering containers, managing custom properties, and presenting flag controls.

Initialize the iOS Swift SDK (setup)

public static func setup(withKey key: String) public static func setup(withKey key: String, options: ROXOptions?)

Initializes the SDK and connects to CloudBees Unify. Loads cached flag container and executes async network call to fetch current configuration. Call during app launch sequence in AppDelegate.application:didFinishLaunchingWithOptions:.

Parameter Type Description

key

String

Environment-specific SDK key from CloudBees Unify.

options

ROXOptions

Optional configuration settings for SDK behavior.

Register flag containers (register)

public static func register(_ container: RoxContainer)

Registers a container instance to CloudBees Unify to make flags available for configuration. Values are updated at sync, setup, or app foreground events. Call only once per container class.

Shut down the iOS Swift SDK (shutdown)

public static func shutdown()

Gracefully shuts down the SDK and cleans all background tasks and threads. Call only when SDK is successfully set up. Can call setup again after shutdown.

Clear cached flag values (unfreeze)

public static func unfreeze()

Clears all cached flag values for immediate re-evaluation. Unfreezes all flags to return most updated values. Use when app needs immediate flag changes without waiting for foreground events.

Display local flag controls (flagsViewController)

public static func flagsViewController() -> UIViewController

Returns view controller for local flag management on device or simulator. Enables developers and QA to view, enable, disable, and reset flag states locally.

Set custom targeting properties (setCustomProperty)

public static func setCustomProperty(key: String, value: String) public static func setCustomProperty(key: String, asSemver value: String)

Defines custom properties for advanced flag targeting. Can assign static values or use closures for dynamic computation.

ROXOptions (iOS Swift)

Configuration options for the iOS Swift SDK, passed to setup(withKey:options:).

appGroupIdentifier

The App Group identifier used to share feature flag state and user identity between your iOS app and its extensions, such as widgets, keyboards, or share extensions. When set, the SDK persists user identity in the shared App Group container, counting the main app and all extensions as a single user with consistent flag values. Leave unset if your app has no extensions. You must enable the App Groups capability in Xcode for the main app and each extension target, using the same identifier across all targets. Refer to Configure iOS app extensions with App Groups for setup steps.

let options = ROXOptions() options.appGroupIdentifier = "group.com.yourcompany.yourapp" ROX.setup(withKey: "your-sdk-key", options: options)

iOS Objective-C SDK methods

The iOS Objective-C SDK provides the ROXCore class as the main interface for feature flag management in iOS applications using Objective-C.

ROXCore class

@interface ROXCore : NSObject

Static facade interface for SDK operations in Objective-C applications.

Initialize the iOS Objective-C SDK (setupWithKey)

+ (void)setupWithKey:(NSString *)roxKey + (void)setupWithKey:(NSString *)roxKey options:(ROXOptions *)options

Loads the SDK during app launch sequence. Fetches flag configuration and calculates targeting rules.

Parameter Type Description

roxKey

NSString

Environment-specific SDK key from CloudBees Unify.

options

ROXOptions

Optional setup configuration options.

Register flag containers (register)

+ (void)register:(ROXBaseContainer *)container + (void)register:(NSString *)namespace container:(ROXBaseContainer *)container

Registers container instance to CloudBees Unify to make flags available for configuration. Optional namespace parameter provides flag prefix for organization. Register each namespace only once.

Shut down the iOS Objective-C SDK (shutdown)

+ (void)shutdown

Gracefully shuts down SDK and cleans background tasks. Call only when SDK successfully set up.

Clear cached flag values (unfreeze)

+ (void)unfreeze + (void)unfreezeNamespace:(NSString *)ns

Unfreezes all coded flags or flags within specified namespace. Returns most updated flag values after unfreezing.

ROXOptions (iOS Objective-C)

Configuration options for the iOS Objective-C SDK, passed to setupWithKey:options:.

appGroupIdentifier

The App Group identifier used to share feature flag state and user identity between your iOS app and its extensions. When set, the SDK persists user identity in the shared App Group container, counting the main app and all extensions as a single user with consistent flag values. Leave unset if your app has no extensions. You must enable the App Groups capability in Xcode for the main app and each extension target, using the same identifier across all targets. Refer to Configure iOS app extensions with App Groups for setup steps.

ROXOptions *options = [[ROXOptions alloc] init]; options.appGroupIdentifier = @"group.com.yourcompany.yourapp"; [ROX setupWithKey:@"your-sdk-key" options:options];

React Native SDK methods

The React Native SDK provides the Rox object as the main interface for feature flag management in React Native applications.

Rox object

JavaScript/TypeScript interface for React Native applications using cross-platform SDK methods.

Initialize the React Native SDK (setup)

Rox.setup(appKey, options)

Initializes SDK with configuration options. Returns promise that resolves when configuration is retrieved from CloudBees Unify.

React Native SDK configuration options

Configuration options control SDK behavior, logging verbosity, callback handling, and network settings for React Native applications.

Parameter Type Description

version

String

React Native client version identifier.

debugLevel

String

SDK verbosity level. Accepts verbose for detailed logging.

configurationFetchedHandler

Function

Callback executed after data sync from CloudBees Unify.

impressionHandler

Function

Callback for flag value computation and evaluation events.

freeze

String

Default freeze level: untilLaunch or none. Default is none.

platform

String

Custom platform override for specialized environments.

dynamicPropertyRuleHandler

Function

Callback for property condition evaluation without prior configuration.

Proxy

Object

Network proxy configuration for SDK requests to CloudBees Unify.

Common Flag Types

Mobile SDKs support multiple flag types for different data types and use cases across Android, iOS, and React Native platforms.

RoxFlag (Boolean)

Binary feature flag for on/off functionality. Returns boolean values based on configuration and targeting rules.

RoxString

String-based feature flag for text content or configuration values. Supports multiple string variations based on targeting conditions.

RoxInt / RoxDouble

Numeric feature flags for integers and floating-point values. Enable gradual rollouts and A/B testing with numeric variations.

SDK Options Configuration

SDK configuration options control logging behavior, flag evaluation timing, and callback execution across all mobile platforms.

Logging Levels

Logging levels control the verbosity of SDK output for debugging and monitoring purposes.

VERBOSE_LEVEL_SILENT

No SDK logging output.

VERBOSE_LEVEL_DEBUG

Debug information and error messages.

VERBOSE_LEVEL_VERBOSE

Detailed logging including network requests and flag evaluations.

Freeze Modes

Freeze modes determine when flag values are cached and when they re-evaluate against current configuration.

none

Flags re-evaluate on each access with current configuration.

untilLaunch

Flag values frozen until next app launch or explicit unfreeze.

Callback Handlers

Callback handlers enable custom logic execution during SDK lifecycle events and flag evaluations.

configurationFetchedHandler

Executes when SDK completes configuration sync with CloudBees Unify. Receives fetch results indicating success or failure status.

impressionHandler

Triggers when flag value is computed and evaluated. Does not trigger for overridden or frozen flags.