ROXCore

@interface ROXCore : NSObject

ROXCore class is a static objc class that acts as an facade interface

  • You use this flag for the following:

  • Loads the SDK, usually called as part of -[AppDelegate application:didFinishLaunchingWithOptions:]

    Checks if a cached experimentation container exists, and loads a container.

    Executes an async network call to fetch the experiment container from the ROX server and calculates experiments and target groups.

    Declaration

    Objective-C

    + (void)setupWithKey:(NSString *)roxKey;

    Parameters

    roxKey

    The app key (taken from ROX dashboard)

  • Loads the SDK, usually called as part of -[AppDelegate application:didFinishLaunchingWithOptions:]

    Checks if a cached experimentation container exists, and loads a container.

    Executes an async network call to fetch the experiment container from the ROX server and calculates experiments and target groups.

    Declaration

    Objective-C

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

    Parameters

    roxKey

    The app key (taken from ROX dashboard)

    options

    setup options

  • Register a container instance to ROX system, the same instance can be retrieved by using +getContainer: function

  • @params container The instance to register, this instance values are set at +sync, +setupWithKey:, or a if the app goes into foreground

  • Note

    this method should be called only once for a given class
  • Declaration

    Objective-C

    + (void) register:(ROXBaseContainer *)container;

    Parameters

    container
  • Retrieve an instance from type clazz that was registered with ROX.register(_:)

    Declaration

    Objective-C

    + (NSObject *)getContainer:(Class)clazz;

    Parameters

    clazz

    The type of instance you want to retrieve

    Return Value

    The instance that was registered

  • Recalculate the rules of experiments allocation base on new data

    See

    +unfreeze

    Note

    Usually called after the user has logged in to refresh ROX custom properties

    Note

    if a flag has already been used (had impression) is is freezed and the calculation will not change the flag state, to change the flag state you need to unfreeze the flag right after the sync call

    Declaration

    Objective-C

    + (void)sync;
  • Unfreeze the state of all flags in code

    When a flag is used in code, his value gets frozen in the app untill the next app foreground event. Calling this function will unfreeze all flags, and using a flag will return it’s most updated value

    Declaration

    Objective-C

    + (void)unfreeze;
  • A view to control feature flags values locally on a mobile device or simulator.

    ROX ViewController allows developers, QA or internal employees (depending on policy) to view, disable, enable and reset the state of their flags locally on the device. The functions return 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.

    Declaration

    Objective-C

    + (id)flagsViewController;

    Return Value

    ViewController which shows the local feature flags and provides an interface to turn them on or off.

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomStringProperty:(NSString *)value forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    value

    The value of the custom property

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomComputedStringProperty:(NSString * (^)())block
                                     forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    block

    this block will get invoked when trying to evaluate the value of the property

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomBooleanProperty:(BOOL)value forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    value

    The value of the custom property

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomComputedBooleanProperty:(BOOL (^)())block
                                      forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    block

    this block will get invoked when trying to evaluate the value of the property

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomIntProperty:(int)value forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    value

    The value of the custom property

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomComputedIntProperty:(int (^)())block forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    block

    this block will get invoked when trying to evaluate the value of the property

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomDoubleProperty:(double)value forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    value

    The value of the custom property

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomComputedDoubleProperty:(double (^)())block
                                     forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    block

    this block will get invoked when trying to evaluate the value of the property

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomSemverProperty:(NSString *)value forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    value

    The value of the custom property

  • Sets a custom property value that can be used when creating target groups.

    Declaration

    Objective-C

    + (void)setCustomComputedSemverProperty:(NSString * (^)())block
                                     forKey:(NSString *)key;

    Parameters

    key

    The name of the custom property

    block

    this block will get invoked when trying to evaluate the value of the property

  • Checks if device is a test device.

    Test device are managed by App Settings in the dashboard

    Declaration

    Objective-C

    + (BOOL)roxDisabled;

    Return Value

    true if device is test device, false otherwise.