diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bb460e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..ca22093 --- /dev/null +++ b/Package.swift @@ -0,0 +1,36 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "ROX", + platforms: [.iOS(.v8), .tvOS(.v10)], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "ROXCore", + targets: ["ROXCore"]), + .library( + name: "ROX", + targets: ["ROX"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .binaryTarget(name: "ROXCore", + path: "ROXCore.xcframework"), + .target( + name: "ROX", + dependencies: ["ROXCore"], + path: "RoxSdk/RoxSdk", + exclude: [ + "Info.plist", + "RoxSdk.h" + ]) + ] +) diff --git a/ROXCore.xcframework/Info.plist b/ROXCore.xcframework/Info.plist new file mode 100644 index 0000000..282b350 --- /dev/null +++ b/ROXCore.xcframework/Info.plist @@ -0,0 +1,39 @@ + + + + + AvailableLibraries + + + LibraryIdentifier + ios-arm64 + LibraryPath + ROXCore.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + LibraryIdentifier + ios-x86_64-simulator + LibraryPath + ROXCore.framework + SupportedArchitectures + + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXBaseContainer.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXBaseContainer.h new file mode 100644 index 0000000..8d462b8 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXBaseContainer.h @@ -0,0 +1,22 @@ +// +// ROXBaseContainer.h +// ROX +// +// Created by Elad Cohen on 6/27/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import + +/** + A container class for configurations and flags + + Any class that inherits from this base class can be used as an entry point for flags and configurations that are controlled by ROX system. To use an instance of this class you need to register the instance using the `+[ROXCore register:]` + method and retrieve the instance using `+[ROXCore get:]` method + + + */ + +@interface ROXBaseContainer : NSObject + +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationBool.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationBool.h new file mode 100644 index 0000000..b08c4a0 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationBool.h @@ -0,0 +1,34 @@ +// +// ROXConfigurationBool.h +// ROX +// +// Created by Elad Cohen on 7/10/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import "ROXRemoteVariable.h" +#import "ROXFreeze.h" +/** + This class is the API for a remote configuration Bool that is controlled by ROX server, on init you assing a default value to that string that can be changed by the configuration tab in ROX dashboard + */ +@interface ROXConfigurationBool : ROXRemoteVariable +NS_ASSUME_NONNULL_BEGIN +/** + :nodoc: + */ +- (_Nonnull instancetype)init __attribute__((deprecated("Default init function is not available"))); +/** + Initiate the configuration with a defaultValue + + @param defaultValue value that is retrieve by `value` unless configured differently on ROX + */ +- (_Nonnull instancetype) initWithDefaultValue:(BOOL)defaultValue; + +- (_Nonnull instancetype) initWithDefaultValue:(BOOL)defaultValue freeze:(ROXFreeze)freeze; + +/** + The BOOL value, if nothing is configured on ROX dashboard, the default value will be returned + */ +@property (nonatomic, readonly) BOOL value; +NS_ASSUME_NONNULL_END +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationDouble.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationDouble.h new file mode 100644 index 0000000..351c6ea --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationDouble.h @@ -0,0 +1,36 @@ +// +// ROXConfigurationDouble.h +// ROX +// +// Created by Elad Cohen on 7/10/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import "ROXRemoteVariable.h" +#import "ROXFreeze.h" +/** + This class is the API for a remote configuration Double that is controlled by ROX server, on init you assing a default value to that string that can be changed by the configuration tab in ROX dashboard + */ +@interface ROXConfigurationDouble : ROXRemoteVariable + +NS_ASSUME_NONNULL_BEGIN +/** + :nodoc: + */ +- (_Nonnull instancetype)init __attribute__((deprecated("Default init function is not available"))); + +/** + Initiate the configuration with a defaultValue + + @param defaultValue value that is retrieve by `value` unless configured differently on ROX + */ +- (_Nonnull instancetype) initWithDefaultValue:(double)defaultValue; + +- (_Nonnull instancetype) initWithDefaultValue:(double)defaultValue freeze:(ROXFreeze)freeze; + +/** + The double value, if nothing is configured on ROX dashboard, the default value will be returned + */ +@property (nonatomic, readonly) double value; +NS_ASSUME_NONNULL_END +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationInt.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationInt.h new file mode 100644 index 0000000..f7a16fa --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationInt.h @@ -0,0 +1,38 @@ +// +// ROXConfigurationInt.h +// ROX +// +// Created by Elad Cohen on 7/10/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import "ROXRemoteVariable.h" +#import "ROXFreeze.h" +/** + This class is the API for a remote configuration int that is controlled by ROX server, on init you assing a default value to that string that can be changed by the configuration tab in ROX dashboard + */ +@interface ROXConfigurationInt : ROXRemoteVariable + +NS_ASSUME_NONNULL_BEGIN +/** + :nodoc: + */ +- (_Nonnull instancetype)init __attribute__((deprecated("Default init function is not available"))); + + +/** + Initiate the configuration with a defaultValue + + @param defaultValue value that is retrieve by `value` unless configured differently on ROX + */ +- (_Nonnull instancetype) initWithDefaultValue:(int)defaultValue; + +- (_Nonnull instancetype) initWithDefaultValue:(int)defaultValue freeze:(ROXFreeze)freeze; + +/** + The int value, if nothing is configured on ROX dashboard, the default value will be returned + */ +@property (nonatomic, readonly) int value; +NS_ASSUME_NONNULL_END +@end + diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationString.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationString.h new file mode 100644 index 0000000..e50abb6 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXConfigurationString.h @@ -0,0 +1,40 @@ +// +// ROXConfigurationString.h +// ROX +// +// Created by Elad Cohen on 7/10/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import "ROXRemoteVariable.h" +#import "ROXFreeze.h" +/** + This class is the API for a remote configuration String that is controlled by ROX server, on init you assing a default value to that string that can be changed by the configuration tab in ROX dashboard + */ + +@interface ROXConfigurationString : ROXRemoteVariable +NS_ASSUME_NONNULL_BEGIN +/** + :nodoc: + */ + +- (_Nonnull instancetype)init __attribute__((deprecated("Default init function is not available"))); + +/** + Initiate the configuration with a defaultValue + + @param defaultValue value that is retrieve by `value` unless configured differently on ROX + */ + +- (_Nonnull instancetype) initWithDefaultValue:(NSString* _Nonnull)defaultValue; + +- (_Nonnull instancetype) initWithDefaultValue:(NSString* _Nonnull)defaultValue freeze:(ROXFreeze)freeze; + +/** + The BOOL value, if nothing is configured on ROX dashboard, the default value will be returned + */ + +@property (nonatomic, readonly, nonnull) NSString* value; +NS_ASSUME_NONNULL_END + +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXCore.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXCore.h new file mode 100644 index 0000000..55ca12c --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXCore.h @@ -0,0 +1,233 @@ +// +// ROXCore SDK version 4.10.16, Build 554 +// +// Copyright (c) 2017 rollout.io. All rights reserved. +// + +#import +#import +#import "ROXOptions.h" +#import "ROXFlag.h" +#import "ROXConfigurationString.h" +#import "ROXConfigurationInt.h" +#import "ROXConfigurationDouble.h" +#import "ROXConfigurationBool.h" +#import "ROXBaseContainer.h" +#import "ROXVariant.h" +#import "ROXFreeze.h" +#import "ROXFetcherResult.h" +#import "ROXReportingValue.h" +#import "ROXExperiment.h" +#import "ROXFlagsOverrides.h" + +#define ROX ROXCore + +/** + ROXCore class is a static objc class that acts as an facade interface + - You use this flag for the following: + + - Intialize ROX SDK using `+setupWithKey:` + - Register container instances using `+register:` + - Load custom properties with setCustomPropertyKey:value: methods + - Present the flags view controller with `+flagsViewController` + + + */ +@interface ROXCore : NSObject + +/** + 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. + + @param roxKey The app key (taken from ROX dashboard) + */ ++(void)setupWithKey:(NSString *)roxKey; + +/** + 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. + + @param roxKey The app key (taken from ROX dashboard) + @param options setup options + */ ++(void)setupWithKey:(NSString *)roxKey options:(ROXOptions *)options; + +/** + Register a container instance to ROX system. + - @param namespace The namespace to to register the container with (all flags / configuration will be prefixed with the namespace). + - @param container The instance to register, this instance values are fetched at `+setupWithKey:`, or when the app goes into foreground. + - @note This method should be called **only once** for a given namespace. + */ ++(void) register:(NSString *)namespace container:(ROXBaseContainer *)container; + ++(void) handleNamespace:(NSString *)namespace; + +/** + 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 + + @see [Flags Consistency](https://support.rollout.io/docs/flags-consistency) + + */ ++(void) unfreeze; ++(void) unfreezeNamespace:(NSString*)ns; + +/** + 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. + + @see [How to setup flagsviewController](https://support.rollout.io/docs/flags-override-view) + + @return ViewController which shows the local feature flags and provides an interface to turn them on or off. + */ ++ (UIViewController*)flagsViewController; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomStringProperty:(NSString*)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedStringProperty:(NSString* (^)(NSString*))block forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomBooleanProperty:(BOOL)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedBooleanProperty:(BOOL (^)(NSString*))block forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomIntProperty:(int)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedIntProperty:(int (^)(NSString*))block forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomDoubleProperty:(double)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedDoubleProperty:(double (^)(NSString*))block forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomSemverProperty:(NSString*)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedSemverProperty:(NSString* (^)(NSString*))block forKey:(NSString*)key; + +/** + :nodoc: + */ ++(void) setVariant:(ROXVariant*)variant forKey:(NSString*)key; +/** + :nodoc: + */ ++(ROXVariant*) variantWithKey:(NSString*)key; +/** + :nodoc: + */ ++(void) setRemoteVariable:(ROXRemoteVariable*)remoteVariable forKey:(NSString*)key; +/** + :nodoc: + */ ++(ROXRemoteVariable*) remoteVariableWithKey:(NSString*)key; + +/** + :nodoc: + */ ++(void)fetch; + ++ (ROXFlagsOverrides*)overrides; ++ (NSArray*)flags; + +#ifdef DEBUG +void resetROXDispatchOnce(void); +#endif + +@end + diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXExperiment.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXExperiment.h new file mode 100644 index 0000000..fd6ecb0 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXExperiment.h @@ -0,0 +1,21 @@ + +// +// ROXExperiment.h +// ROX +// +// Created by Elad Cohen on 4/24/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import + +@interface ROXExperiment : NSObject + +@property (nonatomic, readonly) NSString* name; +@property (nonatomic, readonly) NSString* identifier; +@property (nonatomic, readonly) BOOL isArchived; +@property (nonatomic, readonly) NSSet* labels; + +-(instancetype)initWithName:(NSString*)name identifier:(NSString*)identifier isArchived:(BOOL) isArchived labels:(NSSet*)labels; + +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFetcherResult.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFetcherResult.h new file mode 100644 index 0000000..753f26d --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFetcherResult.h @@ -0,0 +1,28 @@ +// +// ROXFetcherResult.h +// ROX +// +// Created by Elad Cohen on 12/11/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import + +typedef NS_ENUM(NSUInteger, ROXFetcherStatus) { + ROXFetcherStatus_appliedFromEmbedded = 1, + ROXFetcherStatus_appliedFromLocalStorage = 2, + ROXFetcherStatus_appliedFromNetwork = 3, + ROXFetcherStatus_noUpdate = 4, + ROXFetcherStatus_errorFetchFailed = 5 +}; + +@interface ROXFetcherResult : NSObject + +@property (nonatomic) ROXFetcherStatus fetcherStatus; +@property (nonatomic) NSDate* creationDate; +@property (nonatomic) NSString* errorDetails; +@property (nonatomic) BOOL hasChanges; + +- (instancetype)initWithFetcherStatus:(ROXFetcherStatus)fetcherStatus creationDate:(NSDate*)creationDate errorDetails:(NSString*)errorDetails hasChanges:(BOOL)hasChanges; + +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFlag.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFlag.h new file mode 100644 index 0000000..89b8458 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFlag.h @@ -0,0 +1,65 @@ +// +// ROXFlag.h +// ROX +// +// Created by Elad Cohen on 3/19/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import +#import "ROXVariant.h" + + +/** + This class is the API for flags that are controlled by ROX server, Flags are assigned to an experiment and their value is based on experiment container. + */ + +@interface ROXFlag : ROXVariant +NS_ASSUME_NONNULL_BEGIN +/** + a property to indicate if the flag is enabled or disabled + */ +@property (readonly, nonatomic) BOOL isEnabled; + +/** + Runs block is flag is enabled + + @param codeBlock will get invoked (synchronously) if flag is enabled + */ +- (void)enabled:(void (^)(void))codeBlock; + +/** + Runs block is flag is disabled + + @param codeBlock will get invoked (synchronously) if flag is disabled + */ +- (void)disabled:(void (^)(void))codeBlock; +/** + Runs one of the given block based on flag status + + @param enabledCodeBlock will get invoked (synchronously) if flag is enabled + @param disabledCodeBlock will get invoked (synchronously) if flag is disabled + */ + +- (void)enabled:(void (^)(void))enabledCodeBlock disabled:(void (^)(void))disabledCodeBlock; + +/** + Force a value on the flag. This will override any other value (Experiment, Flags View Controller, etc..), and can only be overriden with another call to forceValue: + + @param value to force the sdk with + */ + +- (void)forceValue:(BOOL)value; + +/** + Initialize a flag with a default boolean value + + @param defaultValue a default value for this flag + */ + +- (instancetype)initWithDefault:(BOOL)defaultValue; + +- (instancetype)initWithDefault:(BOOL)defaultValue freeze:(ROXFreeze)freeze; + +@end +NS_ASSUME_NONNULL_END diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFlagsOverrides.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFlagsOverrides.h new file mode 100644 index 0000000..25ead33 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFlagsOverrides.h @@ -0,0 +1,27 @@ +// +// ROXFlagsOverrides.h +// ROX +// +// Created by Hezi Cohen on 3/30/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import +#import "ROXVariant.h" + +@protocol ROXDeviceProperties; +@class ROXFeatureFlagsSetter; + +@interface ROXFlagsOverrides : NSObject + +- (instancetype)initWithFlagSetter:(ROXFeatureFlagsSetter*)setter deviceProperties:(id)deviceProperties; + +- (BOOL)hasOverride:(NSString*)featureName; +- (NSString*)overrideForName:(NSString*)featureName; +- (void)clearOverrideForName:(NSString*)featureName; +- (void)clearOverrides; + +- (void)setOverride:(NSString*)value forFeature:(ROXVariant*)rolloutFeature; +- (NSString*)originalValueForFeature:(ROXVariant*)feature; + +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFreeze.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFreeze.h new file mode 100644 index 0000000..e24ca24 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXFreeze.h @@ -0,0 +1,5 @@ +typedef NS_ENUM(NSUInteger, ROXFreeze) { + ROXFreeze_untilLaunch = 1, + ROXFreeze_untilForeground = 2, + ROXFreeze_none = 3 +}; diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXOptions.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXOptions.h new file mode 100644 index 0000000..771811c --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXOptions.h @@ -0,0 +1,68 @@ +// +// Created by Sergey Ilyevsky on 11/19/14. +// Copyright (c) 2014 DeDoCo. All rights reserved. +// + +#import +#import "ROXFreeze.h" +#import "ROXFetcherResult.h" +#import "ROXReportingValue.h" +#import "ROXExperiment.h" +#import "ROXSelfManagedOptions.h" + +/** + :nodoc: + */ + +typedef void (^ROXConfigurationFetchedHandler)(ROXFetcherResult* _Nonnull result); +typedef void (^ROXImpressionHandler)(ROXReportingValue* _Nonnull value, ROXExperiment* _Nullable experiment); + +/** + The enum to define SDK verbosilty level + @see `ROXOptions.verbose` + */ +typedef NS_ENUM (NSUInteger, ROXOptionsVerboseLevel){ + ///Silent log + ROXOptionsVerboseLevelSilent, + ///Verbsoe log + ROXOptionsVerboseLevelDebug +} /** :nodoc: */; + +/** + This is the configuration class that is used when running `+[ROXCore setupWithKey:options:]`. + */ +@interface ROXOptions : NSObject + +/** + :nodoc: + */ +@property (nonatomic, copy, nullable) ROXConfigurationFetchedHandler onConfigurationFetched; + +@property (nonatomic, copy, nullable) ROXImpressionHandler impressionHandler; +/** + :nodoc: + */ +@property (nonatomic) BOOL disableSyncLoadingFallback; +/** + Set SDK verbosity level for debugging + */ +@property (nonatomic) ROXOptionsVerboseLevel verbose; +/** + :nodoc: + */ +@property (nonatomic, strong) NSArray * _Nullable silentFiles; +/** + :nodoc: + */ +@property (nonatomic, copy) NSString * _Nullable customSigningCertificate; +/** + :nodoc: + */ +@property (nonatomic, copy) NSString * _Nullable defaultConfigurationPath; + +@property (nonatomic) ROXFreeze defaultFreezeLevel; + +@property (nonatomic, copy, nullable) ROXSelfManagedOptions* selfManaged; + +@end + diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXRemoteVariable.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXRemoteVariable.h new file mode 100644 index 0000000..94870b9 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXRemoteVariable.h @@ -0,0 +1,21 @@ +// +// ROXRemoteVariable.h +// ROX +// +// Created by Gal Saada on 19/06/2017. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import +/** + Base class for remote variables + */ +@interface ROXRemoteVariable : NSObject +/** + The full name of the remote variable (including namespace) + */ +@property(nonatomic, readonly) NSString *name; + +- (void)unfreeze; + +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXReportingValue.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXReportingValue.h new file mode 100644 index 0000000..73eb268 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXReportingValue.h @@ -0,0 +1,33 @@ +// +// ROXReportingValue.h +// ROX +// +// Created by Elad Cohen on 7/31/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import + +/** + This class contains data about values of an experiement + + @see `ROXExperiment` + @see `ROXOMetadata` + */ + +@interface ROXReportingValue : NSObject + +/** + Name of the reporting + */ +@property (nonatomic, readonly) NSString* name; +/** + Value of the reporting + */ +@property (nonatomic, readonly) NSString* value; +/** + :nodoc: + */ +- (instancetype)initWithName:(NSString*)name value:(NSString*)value; + +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXSelfManagedOptions.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXSelfManagedOptions.h new file mode 100644 index 0000000..65cc66c --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXSelfManagedOptions.h @@ -0,0 +1,16 @@ +// +// ROXSelfManagedOptions.h +// ROX +// +// Created by asaf meir on 16/04/2020. +// Copyright © 2020 DeDoCo. All rights reserved. +// +#import + +@interface ROXSelfManagedOptions : NSObject + +@property (nonatomic, copy) NSString * _Nullable serverURL; + +@property (nonatomic, copy) NSString * _Nullable analyticsURL; + +@end diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXVariant.h b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXVariant.h new file mode 100644 index 0000000..dd89496 --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Headers/ROXVariant.h @@ -0,0 +1,35 @@ +// +// ROXVariant.h +// ROX +// +// Created by Elad Cohen on 6/28/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import +#import "ROXFreeze.h" +/** + :nodoc: + */ +@interface ROXVariant : NSObject +{ + NSString* _value; + BOOL isFreezed; +} +NS_ASSUME_NONNULL_BEGIN +@property (readonly, nonatomic) NSString* name; +@property (readonly, nonatomic) NSArray* options; + +- (instancetype)initWithDefault:(NSString*)defaultValue; +- (instancetype)initWithDefault:(NSString*)defaultValue options:(NSArray*)options; +- (instancetype)initWithDefault:(NSString*)defaultValue options:(NSArray*)options freeze:(ROXFreeze)freeze; + + +- (NSString*)value; +- (NSString*)defaultValue; +- (void)forceValue:(NSString*)value; +- (void)unfreeze; +- (NSString*)peek; + +@end +NS_ASSUME_NONNULL_END diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Info.plist b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Info.plist new file mode 100644 index 0000000..74db827 Binary files /dev/null and b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Info.plist differ diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/Modules/module.modulemap b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Modules/module.modulemap new file mode 100644 index 0000000..bd57a8e --- /dev/null +++ b/ROXCore.xcframework/ios-arm64/ROXCore.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module ROXCore { + umbrella header "ROXCore.h" + + export * + module * { export * } +} diff --git a/ROXCore.xcframework/ios-arm64/ROXCore.framework/ROXCore b/ROXCore.xcframework/ios-arm64/ROXCore.framework/ROXCore new file mode 100755 index 0000000..53d4768 Binary files /dev/null and b/ROXCore.xcframework/ios-arm64/ROXCore.framework/ROXCore differ diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXBaseContainer.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXBaseContainer.h new file mode 100644 index 0000000..8d462b8 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXBaseContainer.h @@ -0,0 +1,22 @@ +// +// ROXBaseContainer.h +// ROX +// +// Created by Elad Cohen on 6/27/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import + +/** + A container class for configurations and flags + + Any class that inherits from this base class can be used as an entry point for flags and configurations that are controlled by ROX system. To use an instance of this class you need to register the instance using the `+[ROXCore register:]` + method and retrieve the instance using `+[ROXCore get:]` method + + + */ + +@interface ROXBaseContainer : NSObject + +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationBool.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationBool.h new file mode 100644 index 0000000..b08c4a0 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationBool.h @@ -0,0 +1,34 @@ +// +// ROXConfigurationBool.h +// ROX +// +// Created by Elad Cohen on 7/10/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import "ROXRemoteVariable.h" +#import "ROXFreeze.h" +/** + This class is the API for a remote configuration Bool that is controlled by ROX server, on init you assing a default value to that string that can be changed by the configuration tab in ROX dashboard + */ +@interface ROXConfigurationBool : ROXRemoteVariable +NS_ASSUME_NONNULL_BEGIN +/** + :nodoc: + */ +- (_Nonnull instancetype)init __attribute__((deprecated("Default init function is not available"))); +/** + Initiate the configuration with a defaultValue + + @param defaultValue value that is retrieve by `value` unless configured differently on ROX + */ +- (_Nonnull instancetype) initWithDefaultValue:(BOOL)defaultValue; + +- (_Nonnull instancetype) initWithDefaultValue:(BOOL)defaultValue freeze:(ROXFreeze)freeze; + +/** + The BOOL value, if nothing is configured on ROX dashboard, the default value will be returned + */ +@property (nonatomic, readonly) BOOL value; +NS_ASSUME_NONNULL_END +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationDouble.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationDouble.h new file mode 100644 index 0000000..351c6ea --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationDouble.h @@ -0,0 +1,36 @@ +// +// ROXConfigurationDouble.h +// ROX +// +// Created by Elad Cohen on 7/10/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import "ROXRemoteVariable.h" +#import "ROXFreeze.h" +/** + This class is the API for a remote configuration Double that is controlled by ROX server, on init you assing a default value to that string that can be changed by the configuration tab in ROX dashboard + */ +@interface ROXConfigurationDouble : ROXRemoteVariable + +NS_ASSUME_NONNULL_BEGIN +/** + :nodoc: + */ +- (_Nonnull instancetype)init __attribute__((deprecated("Default init function is not available"))); + +/** + Initiate the configuration with a defaultValue + + @param defaultValue value that is retrieve by `value` unless configured differently on ROX + */ +- (_Nonnull instancetype) initWithDefaultValue:(double)defaultValue; + +- (_Nonnull instancetype) initWithDefaultValue:(double)defaultValue freeze:(ROXFreeze)freeze; + +/** + The double value, if nothing is configured on ROX dashboard, the default value will be returned + */ +@property (nonatomic, readonly) double value; +NS_ASSUME_NONNULL_END +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationInt.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationInt.h new file mode 100644 index 0000000..f7a16fa --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationInt.h @@ -0,0 +1,38 @@ +// +// ROXConfigurationInt.h +// ROX +// +// Created by Elad Cohen on 7/10/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import "ROXRemoteVariable.h" +#import "ROXFreeze.h" +/** + This class is the API for a remote configuration int that is controlled by ROX server, on init you assing a default value to that string that can be changed by the configuration tab in ROX dashboard + */ +@interface ROXConfigurationInt : ROXRemoteVariable + +NS_ASSUME_NONNULL_BEGIN +/** + :nodoc: + */ +- (_Nonnull instancetype)init __attribute__((deprecated("Default init function is not available"))); + + +/** + Initiate the configuration with a defaultValue + + @param defaultValue value that is retrieve by `value` unless configured differently on ROX + */ +- (_Nonnull instancetype) initWithDefaultValue:(int)defaultValue; + +- (_Nonnull instancetype) initWithDefaultValue:(int)defaultValue freeze:(ROXFreeze)freeze; + +/** + The int value, if nothing is configured on ROX dashboard, the default value will be returned + */ +@property (nonatomic, readonly) int value; +NS_ASSUME_NONNULL_END +@end + diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationString.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationString.h new file mode 100644 index 0000000..e50abb6 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXConfigurationString.h @@ -0,0 +1,40 @@ +// +// ROXConfigurationString.h +// ROX +// +// Created by Elad Cohen on 7/10/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import "ROXRemoteVariable.h" +#import "ROXFreeze.h" +/** + This class is the API for a remote configuration String that is controlled by ROX server, on init you assing a default value to that string that can be changed by the configuration tab in ROX dashboard + */ + +@interface ROXConfigurationString : ROXRemoteVariable +NS_ASSUME_NONNULL_BEGIN +/** + :nodoc: + */ + +- (_Nonnull instancetype)init __attribute__((deprecated("Default init function is not available"))); + +/** + Initiate the configuration with a defaultValue + + @param defaultValue value that is retrieve by `value` unless configured differently on ROX + */ + +- (_Nonnull instancetype) initWithDefaultValue:(NSString* _Nonnull)defaultValue; + +- (_Nonnull instancetype) initWithDefaultValue:(NSString* _Nonnull)defaultValue freeze:(ROXFreeze)freeze; + +/** + The BOOL value, if nothing is configured on ROX dashboard, the default value will be returned + */ + +@property (nonatomic, readonly, nonnull) NSString* value; +NS_ASSUME_NONNULL_END + +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXCore.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXCore.h new file mode 100644 index 0000000..55ca12c --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXCore.h @@ -0,0 +1,233 @@ +// +// ROXCore SDK version 4.10.16, Build 554 +// +// Copyright (c) 2017 rollout.io. All rights reserved. +// + +#import +#import +#import "ROXOptions.h" +#import "ROXFlag.h" +#import "ROXConfigurationString.h" +#import "ROXConfigurationInt.h" +#import "ROXConfigurationDouble.h" +#import "ROXConfigurationBool.h" +#import "ROXBaseContainer.h" +#import "ROXVariant.h" +#import "ROXFreeze.h" +#import "ROXFetcherResult.h" +#import "ROXReportingValue.h" +#import "ROXExperiment.h" +#import "ROXFlagsOverrides.h" + +#define ROX ROXCore + +/** + ROXCore class is a static objc class that acts as an facade interface + - You use this flag for the following: + + - Intialize ROX SDK using `+setupWithKey:` + - Register container instances using `+register:` + - Load custom properties with setCustomPropertyKey:value: methods + - Present the flags view controller with `+flagsViewController` + + + */ +@interface ROXCore : NSObject + +/** + 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. + + @param roxKey The app key (taken from ROX dashboard) + */ ++(void)setupWithKey:(NSString *)roxKey; + +/** + 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. + + @param roxKey The app key (taken from ROX dashboard) + @param options setup options + */ ++(void)setupWithKey:(NSString *)roxKey options:(ROXOptions *)options; + +/** + Register a container instance to ROX system. + - @param namespace The namespace to to register the container with (all flags / configuration will be prefixed with the namespace). + - @param container The instance to register, this instance values are fetched at `+setupWithKey:`, or when the app goes into foreground. + - @note This method should be called **only once** for a given namespace. + */ ++(void) register:(NSString *)namespace container:(ROXBaseContainer *)container; + ++(void) handleNamespace:(NSString *)namespace; + +/** + 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 + + @see [Flags Consistency](https://support.rollout.io/docs/flags-consistency) + + */ ++(void) unfreeze; ++(void) unfreezeNamespace:(NSString*)ns; + +/** + 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. + + @see [How to setup flagsviewController](https://support.rollout.io/docs/flags-override-view) + + @return ViewController which shows the local feature flags and provides an interface to turn them on or off. + */ ++ (UIViewController*)flagsViewController; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomStringProperty:(NSString*)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedStringProperty:(NSString* (^)(NSString*))block forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomBooleanProperty:(BOOL)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedBooleanProperty:(BOOL (^)(NSString*))block forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomIntProperty:(int)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedIntProperty:(int (^)(NSString*))block forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomDoubleProperty:(double)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedDoubleProperty:(double (^)(NSString*))block forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param value The value of the custom property + + */ ++(void) setCustomSemverProperty:(NSString*)value forKey:(NSString*)key; + +/** + Sets a custom property value that can be used when creating target groups. + + @see [Creating a target group](https://support.rollout.io/docs/creating-target-groups) + + @param key The name of the custom property + @param block this block will get invoked when trying to evaluate the value of the property + + */ ++(void) setCustomComputedSemverProperty:(NSString* (^)(NSString*))block forKey:(NSString*)key; + +/** + :nodoc: + */ ++(void) setVariant:(ROXVariant*)variant forKey:(NSString*)key; +/** + :nodoc: + */ ++(ROXVariant*) variantWithKey:(NSString*)key; +/** + :nodoc: + */ ++(void) setRemoteVariable:(ROXRemoteVariable*)remoteVariable forKey:(NSString*)key; +/** + :nodoc: + */ ++(ROXRemoteVariable*) remoteVariableWithKey:(NSString*)key; + +/** + :nodoc: + */ ++(void)fetch; + ++ (ROXFlagsOverrides*)overrides; ++ (NSArray*)flags; + +#ifdef DEBUG +void resetROXDispatchOnce(void); +#endif + +@end + diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXExperiment.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXExperiment.h new file mode 100644 index 0000000..fd6ecb0 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXExperiment.h @@ -0,0 +1,21 @@ + +// +// ROXExperiment.h +// ROX +// +// Created by Elad Cohen on 4/24/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import + +@interface ROXExperiment : NSObject + +@property (nonatomic, readonly) NSString* name; +@property (nonatomic, readonly) NSString* identifier; +@property (nonatomic, readonly) BOOL isArchived; +@property (nonatomic, readonly) NSSet* labels; + +-(instancetype)initWithName:(NSString*)name identifier:(NSString*)identifier isArchived:(BOOL) isArchived labels:(NSSet*)labels; + +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFetcherResult.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFetcherResult.h new file mode 100644 index 0000000..753f26d --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFetcherResult.h @@ -0,0 +1,28 @@ +// +// ROXFetcherResult.h +// ROX +// +// Created by Elad Cohen on 12/11/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import + +typedef NS_ENUM(NSUInteger, ROXFetcherStatus) { + ROXFetcherStatus_appliedFromEmbedded = 1, + ROXFetcherStatus_appliedFromLocalStorage = 2, + ROXFetcherStatus_appliedFromNetwork = 3, + ROXFetcherStatus_noUpdate = 4, + ROXFetcherStatus_errorFetchFailed = 5 +}; + +@interface ROXFetcherResult : NSObject + +@property (nonatomic) ROXFetcherStatus fetcherStatus; +@property (nonatomic) NSDate* creationDate; +@property (nonatomic) NSString* errorDetails; +@property (nonatomic) BOOL hasChanges; + +- (instancetype)initWithFetcherStatus:(ROXFetcherStatus)fetcherStatus creationDate:(NSDate*)creationDate errorDetails:(NSString*)errorDetails hasChanges:(BOOL)hasChanges; + +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFlag.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFlag.h new file mode 100644 index 0000000..89b8458 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFlag.h @@ -0,0 +1,65 @@ +// +// ROXFlag.h +// ROX +// +// Created by Elad Cohen on 3/19/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import +#import "ROXVariant.h" + + +/** + This class is the API for flags that are controlled by ROX server, Flags are assigned to an experiment and their value is based on experiment container. + */ + +@interface ROXFlag : ROXVariant +NS_ASSUME_NONNULL_BEGIN +/** + a property to indicate if the flag is enabled or disabled + */ +@property (readonly, nonatomic) BOOL isEnabled; + +/** + Runs block is flag is enabled + + @param codeBlock will get invoked (synchronously) if flag is enabled + */ +- (void)enabled:(void (^)(void))codeBlock; + +/** + Runs block is flag is disabled + + @param codeBlock will get invoked (synchronously) if flag is disabled + */ +- (void)disabled:(void (^)(void))codeBlock; +/** + Runs one of the given block based on flag status + + @param enabledCodeBlock will get invoked (synchronously) if flag is enabled + @param disabledCodeBlock will get invoked (synchronously) if flag is disabled + */ + +- (void)enabled:(void (^)(void))enabledCodeBlock disabled:(void (^)(void))disabledCodeBlock; + +/** + Force a value on the flag. This will override any other value (Experiment, Flags View Controller, etc..), and can only be overriden with another call to forceValue: + + @param value to force the sdk with + */ + +- (void)forceValue:(BOOL)value; + +/** + Initialize a flag with a default boolean value + + @param defaultValue a default value for this flag + */ + +- (instancetype)initWithDefault:(BOOL)defaultValue; + +- (instancetype)initWithDefault:(BOOL)defaultValue freeze:(ROXFreeze)freeze; + +@end +NS_ASSUME_NONNULL_END diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFlagsOverrides.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFlagsOverrides.h new file mode 100644 index 0000000..25ead33 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFlagsOverrides.h @@ -0,0 +1,27 @@ +// +// ROXFlagsOverrides.h +// ROX +// +// Created by Hezi Cohen on 3/30/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import +#import "ROXVariant.h" + +@protocol ROXDeviceProperties; +@class ROXFeatureFlagsSetter; + +@interface ROXFlagsOverrides : NSObject + +- (instancetype)initWithFlagSetter:(ROXFeatureFlagsSetter*)setter deviceProperties:(id)deviceProperties; + +- (BOOL)hasOverride:(NSString*)featureName; +- (NSString*)overrideForName:(NSString*)featureName; +- (void)clearOverrideForName:(NSString*)featureName; +- (void)clearOverrides; + +- (void)setOverride:(NSString*)value forFeature:(ROXVariant*)rolloutFeature; +- (NSString*)originalValueForFeature:(ROXVariant*)feature; + +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFreeze.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFreeze.h new file mode 100644 index 0000000..e24ca24 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXFreeze.h @@ -0,0 +1,5 @@ +typedef NS_ENUM(NSUInteger, ROXFreeze) { + ROXFreeze_untilLaunch = 1, + ROXFreeze_untilForeground = 2, + ROXFreeze_none = 3 +}; diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXOptions.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXOptions.h new file mode 100644 index 0000000..771811c --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXOptions.h @@ -0,0 +1,68 @@ +// +// Created by Sergey Ilyevsky on 11/19/14. +// Copyright (c) 2014 DeDoCo. All rights reserved. +// + +#import +#import "ROXFreeze.h" +#import "ROXFetcherResult.h" +#import "ROXReportingValue.h" +#import "ROXExperiment.h" +#import "ROXSelfManagedOptions.h" + +/** + :nodoc: + */ + +typedef void (^ROXConfigurationFetchedHandler)(ROXFetcherResult* _Nonnull result); +typedef void (^ROXImpressionHandler)(ROXReportingValue* _Nonnull value, ROXExperiment* _Nullable experiment); + +/** + The enum to define SDK verbosilty level + @see `ROXOptions.verbose` + */ +typedef NS_ENUM (NSUInteger, ROXOptionsVerboseLevel){ + ///Silent log + ROXOptionsVerboseLevelSilent, + ///Verbsoe log + ROXOptionsVerboseLevelDebug +} /** :nodoc: */; + +/** + This is the configuration class that is used when running `+[ROXCore setupWithKey:options:]`. + */ +@interface ROXOptions : NSObject + +/** + :nodoc: + */ +@property (nonatomic, copy, nullable) ROXConfigurationFetchedHandler onConfigurationFetched; + +@property (nonatomic, copy, nullable) ROXImpressionHandler impressionHandler; +/** + :nodoc: + */ +@property (nonatomic) BOOL disableSyncLoadingFallback; +/** + Set SDK verbosity level for debugging + */ +@property (nonatomic) ROXOptionsVerboseLevel verbose; +/** + :nodoc: + */ +@property (nonatomic, strong) NSArray * _Nullable silentFiles; +/** + :nodoc: + */ +@property (nonatomic, copy) NSString * _Nullable customSigningCertificate; +/** + :nodoc: + */ +@property (nonatomic, copy) NSString * _Nullable defaultConfigurationPath; + +@property (nonatomic) ROXFreeze defaultFreezeLevel; + +@property (nonatomic, copy, nullable) ROXSelfManagedOptions* selfManaged; + +@end + diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXRemoteVariable.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXRemoteVariable.h new file mode 100644 index 0000000..94870b9 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXRemoteVariable.h @@ -0,0 +1,21 @@ +// +// ROXRemoteVariable.h +// ROX +// +// Created by Gal Saada on 19/06/2017. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import +/** + Base class for remote variables + */ +@interface ROXRemoteVariable : NSObject +/** + The full name of the remote variable (including namespace) + */ +@property(nonatomic, readonly) NSString *name; + +- (void)unfreeze; + +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXReportingValue.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXReportingValue.h new file mode 100644 index 0000000..73eb268 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXReportingValue.h @@ -0,0 +1,33 @@ +// +// ROXReportingValue.h +// ROX +// +// Created by Elad Cohen on 7/31/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import + +/** + This class contains data about values of an experiement + + @see `ROXExperiment` + @see `ROXOMetadata` + */ + +@interface ROXReportingValue : NSObject + +/** + Name of the reporting + */ +@property (nonatomic, readonly) NSString* name; +/** + Value of the reporting + */ +@property (nonatomic, readonly) NSString* value; +/** + :nodoc: + */ +- (instancetype)initWithName:(NSString*)name value:(NSString*)value; + +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXSelfManagedOptions.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXSelfManagedOptions.h new file mode 100644 index 0000000..65cc66c --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXSelfManagedOptions.h @@ -0,0 +1,16 @@ +// +// ROXSelfManagedOptions.h +// ROX +// +// Created by asaf meir on 16/04/2020. +// Copyright © 2020 DeDoCo. All rights reserved. +// +#import + +@interface ROXSelfManagedOptions : NSObject + +@property (nonatomic, copy) NSString * _Nullable serverURL; + +@property (nonatomic, copy) NSString * _Nullable analyticsURL; + +@end diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXVariant.h b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXVariant.h new file mode 100644 index 0000000..dd89496 --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Headers/ROXVariant.h @@ -0,0 +1,35 @@ +// +// ROXVariant.h +// ROX +// +// Created by Elad Cohen on 6/28/17. +// Copyright © 2017 DeDoCo. All rights reserved. +// + +#import +#import "ROXFreeze.h" +/** + :nodoc: + */ +@interface ROXVariant : NSObject +{ + NSString* _value; + BOOL isFreezed; +} +NS_ASSUME_NONNULL_BEGIN +@property (readonly, nonatomic) NSString* name; +@property (readonly, nonatomic) NSArray* options; + +- (instancetype)initWithDefault:(NSString*)defaultValue; +- (instancetype)initWithDefault:(NSString*)defaultValue options:(NSArray*)options; +- (instancetype)initWithDefault:(NSString*)defaultValue options:(NSArray*)options freeze:(ROXFreeze)freeze; + + +- (NSString*)value; +- (NSString*)defaultValue; +- (void)forceValue:(NSString*)value; +- (void)unfreeze; +- (NSString*)peek; + +@end +NS_ASSUME_NONNULL_END diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Info.plist b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Info.plist new file mode 100644 index 0000000..74db827 Binary files /dev/null and b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Info.plist differ diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Modules/module.modulemap b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Modules/module.modulemap new file mode 100644 index 0000000..bd57a8e --- /dev/null +++ b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module ROXCore { + umbrella header "ROXCore.h" + + export * + module * { export * } +} diff --git a/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/ROXCore b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/ROXCore new file mode 100755 index 0000000..0fb6eef Binary files /dev/null and b/ROXCore.xcframework/ios-x86_64-simulator/ROXCore.framework/ROXCore differ diff --git a/lib/build_xcframework.sh b/lib/build_xcframework.sh new file mode 100644 index 0000000..6c767df --- /dev/null +++ b/lib/build_xcframework.sh @@ -0,0 +1,27 @@ +# https://medium.com/strava-engineering/convert-a-universal-fat-framework-to-an-xcframework-39e33b7bd861 +mkdir -p build/iphoneos +mkdir -p build/iphonesimulator + +# Copy framework into the platform specific directories +cp -R RoxSdk/ROXCore.framework/ build/iphoneos/ROXCore.framework +cp -R RoxSdk/ROXCore.framework/ build/iphonesimulator/ROXCore.framework + +# Look at the architectures in the original binary +xcrun lipo -i RoxSdk/ROXCore.framework/ROXCore + +# Remove slices that aren't relevant to the device slice of the xcframework +xcrun lipo -remove i386 -remove x86_64 -remove armv7 ./build/iphoneos/ROXCore.framework/ROXCore -o ./build/iphoneos/ROXCore.framework/ROXCore + +# Confirm the binary has the proper (arm64) slice +xcrun lipo -i build/iphoneos/ROXCore.framework/ROXCore + +# Remove slices that aren't relevant to the simulator slice of the xcframework +xcrun lipo -remove i386 -remove arm64 -remove armv7 ./build/iphonesimulator/ROXCore.framework/ROXCore -o ./build/iphonesimulator/ROXCore.framework/ROXCore + +# Confirm the binary has the proper (x86_64) slice. +xcrun lipo -i build/iphonesimulator/ROXCore.framework/ROXCore + +# Create xcframework from the platform slices +xcodebuild -create-xcframework -framework build/iphoneos/ROXCore.framework/ -framework build/iphonesimulator/ROXCore.framework/ -output "ROXCore.xcframework" + +rm -rf build