Releases: optimizely/objective-c-sdk
Release 2.1.5
Release 2.1.5
December 6th, 2018
This includes a potential fix to a problem with lazy loading the OPTLYFileManager.
New Features
- No new features for this patch release.
Bug Fixes:
- Wrap fileManager accessor in a serial queue to avoid multiple threads creating multiple fileManagers causing an access to memory that is no longer valid.
Release 2.1.4
2.1.4
November 19, 2018
This release fixes remaining issues having to cast to access data model objects. Also, sets TLS minimum version.
New Features
- No new features for this patch release.
Bug Fixes:
- Fix Swift 4 accessing data model properties without cast.
- Pin TLS minimum version.
Release 2.1.3
2.1.3
November 8, 2018
This release fixes a possible issue with tvOS. The issue is that if the app goes foreground and background the events get flushed. However, there might be a removeEvent queued. This remove event was failing because the queue was emptry.
New Features
- No new features for this patch release.
Bug Fixes:
- Fix tvOS issue with the event queue
- Fix Swift 4 accessing ProjectConfig properties such as experiments used to require a cast. That is now fixed.
Release 2.1.2
2.1.2
October 1, 2018
This release supports xcode 10 and Swift 4. This fixes the carthage issue.
New Features
- No new features for this patch release.
Bug Fixes:
- Fix nullable and nonnull tags so that Swift 4 functions properly.
- Rename protocol Optional for JSON to OPTLYOptional.
- Fix logging of attribute as missing when included.
- Fix EventBuilder init nullable.
- Fix build warnings
- Fix Carthage build
Release 2.1.1
2.1.1
September 27, 2018
This release supports xcode 10 and Swift 4. However, there seems to still be an issue with Carthage.
New Features
- No new features for this patch release.
Bug Fixes:
- Fix nullable and nonnull tags so that Swift 4 functions properly.
- Rename protocol Optional for JSON to OPTLYOptional.
Release 2.1.0
2.1.0
August 2nd, 2018
This release is the 2.x general availability launch of the Objective-C SDK, which includes a number of significant new features that are now stable and fully supported. Feature Management is now generally available, which introduces new APIs and which replaces the SDK's variable APIs (getVariableBoolean
, etc.) with the feature variable APIs (getFeatureVariableBoolean
, etc.).
The primary difference between the new Feature Variable APIs and the older, Variable APIs is that they allow you to link your variables to a Feature (a new type of entity defined in the Optimizely UI) and to a feature flag in your application. This in turn allows you to run Feature Tests and Rollouts on both your Features and Feature Variables. For complete details of the Feature Management APIs, see the "New Features" section below.
To learn more about Feature Management, read our knowledge base article introducing the feature.
New Features
- Introduces the
isFeatureEnabled
API, a featue flag used to determine whether to show a feature to a user. TheisFeatureEnabled
should be used in place of theactivate
API to activate experiments running on features. Specifically, calling this API causes the SDK to evaluate all Feature Tests and Rollouts associated with the provided feature key.
/**
* Determine whether a feature is enabled.
* Send an impression event if the user is bucketed into an experiment using the feature.
* @param featureKey The key for the feature flag.
* @param userId The user ID to be used for bucketing.
* @param attributes The user's attributes.
* @return YES if feature is enabled, false otherwise.
*/
- (BOOL)isFeatureEnabled:(nullable NSString *)featureKey userId:(nullable NSString *)userId attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- Get all enabled features for a user by calling the following method, which returns a list of strings representing the feature keys:
/**
* Get array of features that are enabled for the user.
* @param userId The user ID to be used for bucketing.
* @param attributes The user's attributes.
* @return NSArray<NSString> Array of feature keys that are enabled for the user.
*/
- (NSArray<NSString *> *_Nonnull)getEnabledFeatures:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- Introduces Feature Variables to configure or parameterize your feature. There are four variable types:
BOOL
,double
,int
,NSString*
. Note that unlike the Variable APIs, the Feature Variable APIs do not dispatch impression events. Instead, first callisFeatureEnabled
to activate your experiments, then retrieve your variables.
/**
* API's that get feature variable values.
* @param featureKey The key for the feature flag.
* @param variableKey The key for the variable.
* @param userId The user ID to be used for bucketing.
* @param attributes The user's attributes.
* @return feature variable value.
*/
- (NSNumber *)getFeatureVariableBoolean:(nullable NSString *)featureKey
variableKey:(nullable NSString *)variableKey
userId:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- (NSNumber *)getFeatureVariableDouble:(nullable NSString *)featureKey
variableKey:(nullable NSString *)variableKey
userId:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- (NSNumber *)getFeatureVariableInteger:(nullable NSString *)featureKey
variableKey:(nullable NSString *)variableKey
userId:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- (NSString *_Nullable)getFeatureVariableString:(nullable NSString *)featureKey
variableKey:(nullable NSString *)variableKey
userId:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- Introducing Optimizely Notification Center with Notification Listeners
Optimizely object now has a Notification Center
@property (nonatomic, strong, readonly, nullable) OPTLYNotificationCenter *notificationCenter;
with Notification Listeners APIs
- (NSInteger)addActivateNotificationListener:(nonnull ActivateListener)activateListener;
- (NSInteger)addTrackNotificationListener:(TrackListener _Nonnull )trackListener;
- (BOOL)removeNotificationListener:(NSUInteger)notificationId;
- (void)clearNotificationListeners:(OPTLYNotificationType)type;
- (void)clearAllNotificationListeners;
- Introduces SDK Keys, which allow you to use Environments with the Objective-C SDK. Use an SDK Key to initialize your OptimizelyManager, and the SDK will retrieve the datafile for the environment associated with the SDK Key. This replaces initialization with Project ID.
// Create the manager and set the datafile manager
OPTLYManager *manager = [OPTLYManager init:^(OPTLYManagerBuilder * _Nullable builder) {
builder.sdkKey = @"SDK_KEY_HERE";
}];
Deprecations
-
Version 2.1.0 deprecates the Variable APIs:
variableBoolean
,variableDouble
,variableInteger
, andvariableString
-
Replace use of the Variable APIs with Feature Mangement's Feature Variable APIs, described above
-
We will continue to support the Variable APIs until the 3.x release, but we encourage you to upgrade as soon as possible
-
You will see a deprecation warning if using a 2.x SDK with the deprecated Variable APIs, but the APIs will continue to behave as they did in 1.x versions of the SDK
Upgrading from 1.x
In order to begin using Feature Management, you must discontinue use of 1.x variables in your experiments. First, pause and archive all experiments that use variables. Then, contact Optimizely Support in order to have your project converted from the 1.x SDK UI to the 2.x SDK UI. In addition to granting access to the Feature Management UI, upgrading to the 2.x SDK UI grants you access to Environments and other new features.
- Note: All future feature development on the Objective-C SDK will assume that your are using the 2.x SDK UI, so we encourage you to upgrade as soon as possible.
Breaking changes
- The
track
API with revenue value as a stand-alone parameter has been removed. The revenue value should be passed in as an entry of the event tags map. The key for the revenue tag isrevenue
and will be treated by Optimizely as the key for analyzing revenue data in results.
NSDictionary *tags = @{@"revenue" : @6432};
// reserved "revenue" tag
[optimizelyClient track:@"event_key" userId:@"user_1" attributes:nil eventTags:tags];
- We have removed deprecated classes with the
OPTLYNotificationBroadcaster
in favor of the new API with theOPTLYNotificationCenter
. We have also added some convenience methods to add these listeners. Finally, some of the API names have changed slightly (e.g.clearAllNotifications
is nowclearAllNotificationListener
)
Release 2.0.2-beta4
2.0.2-beta4
August 1, 2018
** This is beta 4 and a release candidate. There are several things to note about this pre-release. This release includes Feature Management and is backward compatible. The APIs mentioned in beta 3 are included.
Bug Fixes:
- Force builderWithBlock for OPTLYManagerBuilder.
- Return nil for getFeatureVariable[Integer,Double,Boolean,String] if the value type is incorrect or the feature variable does not exist.
Release 2.0.2-beta3
2.0.2-beta3
July 24, 2018
** This is beta 3 and a possible release candidate. There are several things to note about this pre-release. This release includes Feature Management and is backward compatible. The APIs mentioned in beta 2 are included.
New Features
Same as 2.0.2-beta2 (see below)
- Introduces support for bot filtering.
- Supports Mobile and Fullstack projects.
- Introduces support for Environments.
- Support for Feature Management (see previous release notes).
- Backward support for deprecated Live Variables.
Bug Fixes:
- Fix static init methods that caused problems in Swift 4
Release 2.0.2-beta2
2.0.2-beta2
Jun 25, 2018
This "-beta2" pre-release corrects two significant bugs present in the
previous 2.0.x releases which have been withdrawn. Please note that
2.0+ SDKs are incompatible with existing 1.x Mobile Optimizely
projects. Before you use 2.0+ and Feature Management, please contact
your Optimizely account team. If you are not upgrading to Feature
Management, we recommend remaining on your current 1.x SDK.
This major release of the Optimizely SDK introduces APIs for Feature Management.
New Features
- Introduces the
isFeatureEnabled:userId:attributes:
API to determine whether to show a feature to a user or not.
/**
* Determine whether a feature is enabled.
* Send an impression event if the user is bucketed into an experiment using the feature.
* @param featureKey The key for the feature flag.
* @param userId The user ID to be used for bucketing.
* @param attributes The user's attributes.
* @return YES if feature is enabled, false otherwise.
*/
- (BOOL)isFeatureEnabled:(nullable NSString *)featureKey userId:(nullable NSString *)userId attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- You can get all the enabled features for the user by calling the
getEnabledFeatures:attributes:
API which returns an array of strings representing the feature keys:
/**
* Get array of features that are enabled for the user.
* @param userId The user ID to be used for bucketing.
* @param attributes The user's attributes.
* @return NSArray<NSString> Array of feature keys that are enabled for the user.
*/
- (NSArray<NSString *> *_Nonnull)getEnabledFeatures:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- Introduces Feature Variables to configure or parameterize your feature. There are four variable types:
BOOL
,double
,int
,NSString*
.
/**
* API's that get feature variable values.
* @param featureKey The key for the feature flag.
* @param variableKey The key for the variable.
* @param userId The user ID to be used for bucketing.
* @param attributes The user's attributes.
* @return feature variable value.
*/
- (BOOL)getFeatureVariableBoolean:(nullable NSString *)featureKey
variableKey:(nullable NSString *)variableKey
userId:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- (double)getFeatureVariableDouble:(nullable NSString *)featureKey
variableKey:(nullable NSString *)variableKey
userId:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- (int)getFeatureVariableInteger:(nullable NSString *)featureKey
variableKey:(nullable NSString *)variableKey
userId:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- (NSString *_Nullable)getFeatureVariableString:(nullable NSString *)featureKey
variableKey:(nullable NSString *)variableKey
userId:(nullable NSString *)userId
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
- Introducing Optimizely Notification Center with Notification Listeners
Optimizely object now has a Notification Center
@property (nonatomic, strong, readonly, nullable) OPTLYNotificationCenter *notificationCenter;
with Notification Listeners APIs
- (NSInteger)addActivateNotificationListener:(nonnull ActivateListener)activateListener;
- (NSInteger)addTrackNotificationListener:(TrackListener _Nonnull )trackListener;
- (BOOL)removeNotificationListener:(NSUInteger)notificationId;
- (void)clearNotificationListeners:(OPTLYNotificationType)type;
- (void)clearAllNotificationListeners;
-
Add environments support to SDK with SDK key initialization. A new sdkKey property has been added to OPTLYManagerBuilder
that is an alternative to the older projectId property. -
Added
@"$opt_bucketing_id"
in the attribute map for overriding bucketing using the user id. This string is
available as OptimizelyBucketId in OPTLYEventBuilder.h . -
Adding mobile 2.x data file CDN url change to support FullStack projects without Feature Management V2 schema.
Bug Fixes:
- Fix single quote in events issue. Event was sent repeatedly because it was
unable to be deleted from data store due to syntax error. - Remove "Pod_..." static library from demo app "Embedded Frameworks".
- Fix red Xcode Project Navigator group folder.
Breaking Changes
- Removed track APIs with revenue as a parameter.
- Deprecated live variable APIs.
Release 1.5.2
1.5.2
June 15, 2018
New Features
- Updated SDK targets to Xcode 9.4 recommended settings, pod update'd third party Cocoapods used by the 2 demo apps, and eliminated Xcode 9.4 Build and Analyze warnings for SDK targets.