May 1, 2023
The 4.0.0-beta release introduces a new primary feature, Advanced Audience Targeting enabled through integration with Optimizely Data Platform (ODP) (#455, #470, #471, #477).
You can use ODP, a high-performance Customer Data Platform (CDP), to easily create complex real-time segments (RTS) using first-party and 50+ third-party data sources out of the box. You can create custom schemas that support the user attributes important for your business, and stitch together user behavior done on different devices to better understand and target your customers for personalized user experiences. ODP can be used as a single source of truth for these segments in any Optimizely or 3rd party tool.
With ODP accounts integrated into Optimizely projects, you can build audiences using segments pre-defined in ODP. The SDK will fetch the segments for given users and make decisions using the segments. For access to ODP audience targeting in your Feature Experimentation account, please contact your Customer Success Manager.
This version includes the following changes:
-
New API added to
OptimizelyUserContext
:-
fetchQualifiedSegments()
: this API will retrieve user segments from the ODP server. The fetched segments will be used for audience evaluation. The fetched data will be stored in the local cache to avoid repeated network delays. -
When an
OptimizelyUserContext
is created, the SDK will automatically send an identify request to the ODP server to facilitate observing user activities.
-
-
New APIs added to
OptimizelyClient
:-
sendOdpEvent()
: customers can build/send arbitrary ODP events that will bind user identifiers and data to user profiles in ODP. -
createUserContext()
with anonymous user IDs: user-contexts can be created without a userId. The SDK will create and use a persistentVUID
specific to a device when userId is not provided.
-
For details, refer to our documentation pages:
ODPManager
in the SDK is enabled by default. Unless an ODP account is integrated into the Optimizely projects, mostODPManager
functions will be ignored. If needed,ODPManager
can be disabled whenOptimizelyClient
is instantiated.
March 14, 2023
- We updated our README.md and other non-functional code to reflect that this SDK supports both Optimizely Feature Experimentation and Optimizely Full Stack. (#479).
April 8, 2022
- Remove sources of race conditions in ProjectConfig (#449).
- Clean up URLSession after tasks are completed (#446).
January 6, 2022
-
Add a set of new APIs for overriding and managing user-level flag, experiment and delivery rule decisions. These methods can be used for QA and automated testing purposes. They are an extension of the OptimizelyUserContext interface (#431, #442, #443):
- setForcedDecision
- getForcedDecision
- removeForcedDecision
- removeAllForcedDecisions
For details, refer to our documentation pages: OptimizelyUserContext and Forced Decision methods.
-
Add reachability checking for datafile fetch and event dispatching (#439).
September 15, 2021
- Add new public properties to
OptimizelyConfig
. (#417, #418)- sdkKey
- environmentKey
- attributes
- audiences
- events
- experimentRules and deliveryRules to
OptimizelyFeature
- audiences to
OptimizelyExperiment
- For details, refer to our documentation page: https://docs.developers.optimizely.com/full-stack/v4.0/docs/optimizelyconfig-swift.
OptimizelyFeature.experimentsMap
ofOptimizelyConfig
is deprecated as of this release. Please useOptimizelyFeature.experimentRules
andOptimizelyFeature.deliveryRules
. (#418)
August 6, 2021
- Remove lazy initializations for thread safety. (#422)
June 2, 2021
-
Fix to support multiple clients (sdkKeys). (#401, #402, #405, #406, #407, #408, #409, #410)
- Full thread-safety for additional concurrency requirements
- No resource conflicts for multiple sdkKeys support
- BUILD_LIBRARY_FOR_DISTRIBUTION is turned on to support ABI when clients build own binaries and share within the team. (#403)
April 14, 2021
- DatafileHandler can be customized and set when OptimizelyClient is instantiated. (#384)
- Add watchOS Compatibility. (#390)
- Clean up build and lint warnings. (#397)
February 23, 2021
-
Introducing a new primary interface for retrieving feature flag status, configuration and associated experiment decisions for users (#373, #386). The new
OptimizelyUserContext
class is instantiated withcreateUserContext
and exposes the following APIs to getOptimizelyDecision
:- setAttribute
- decide
- decideAll
- decideForKeys
- trackEvent
-
For details, refer to our documentation page: https://docs.developers.optimizely.com/full-stack/v4.0/docs/swift-sdk.
- Fix a synchronization bug with logger injection (the binder is being updated every inject), which caused rare app crashes. (#387)
November 19, 2020
- Add "enabled" field to decision metadata structure. (#376)
November 4, 2020
- Add support for upcoming application-controlled introduction of tracking for non-experiment Flag decisions. (#370)
October 2, 2020
- Add versioning that follows semantic version types and tests. (#333)
- Fixing log messages for Targeted Rollouts and feature variable evaluation. (#337)
September 22, 2020
- Fix a bucketing error at traffic allocation boundaries. (#365)
- Update DataStore directory on macOS. (#355)
July 9, 2020
- Add more audience evaluation logs. (#336)
May 21, 2020
- Fix a decision bug for multi-rule rollouts (#323)
- Fix to forward resourceTimeout to datafileHandler (#320)
March 30, 2020
- When a datafile download for initialization returns connection errors, the SDK fails to initialize. This is fixed to continue initialization with a cached datafile. (#308)
- Events are not stored persistently in the tvOS devices. (#310, #311)
March 11, 2020
This release includes an enhancement of SDK initialization API to enable SDK updated on cached datafile change. It also fixes known bugs.
-
Add an option for synchronous initialization to enable SDK immediately updated when a new datafile is cached. Unless this feature is enabled, by default, the cached datafile will be used only when the SDK re-starts in the next session. Note that this option is for synchronous initialization only. (#297)
// enable SDK update when a new datafile is cached optimizelyClient.start(datafile: data, doUpdateConfigOnNewDatafile: true) // by default, this feature is disabled optimizelyClient.start(datafile: data)
- When a synchronously-initialized SDK enables background datafile polling and its datafile was changed in the server, the new datafile is cached but SDK is not dynamically updated. (#297)
- When background datafile polling is enabled and app goes to background and comes back to foreground after some delays, datafile fetching is called multiple times back-to-back. (#301)
- NotificationCenter can cause crashes when multiple threads add/call listeners simultaneously. (#304)
January 16, 2020
- Swift Package Manager (SPM) spec changed to iOS10+/tvOS10+
January 15, 2020
This release includes a new API to access project configuration data and other feature enhancements. It also fixes known bugs.
- OptimizelyConfig (#274):
- Call
getOptimizelyConfig()
to get a snapshot copy of project configuration static data. - It returns an
OptimizelyConfig
instance which includes a datafile revision number, all experiments, and feature flags mapped by their key values. - For details, refer to a documentation page: https://docs.developers.optimizely.com/full-stack/docs/optimizelyconfig-swift
- Call
- Add LogEvent Notification (#263):
- Register an event listener with
addLogEventNotificationListener()
- The lister will be called when events are dispatched to the server.
- Register an event listener with
- Turn on "Allow app extensions only" flag in build settings (#277)
- When timerInterval is set to a negative value, EventDispatcher is changed to use the default interval value for batching (instead of disabling batch). Batching is disabled when the timerInterval is set to zero. (#268)
- Upgrade required platforms from iOS9+/tvOS9+ to iOS10+/tvOS10+ (#284)
July 31, 2019
This release is the GA launch of the Swift SDK. It is a pure Swift implementation which takes complete advantage of language features and performance. It supports Objective-C applications as well.
This modernized version of the SDK is meant to replace the Objective-C SDK.
In addition to all features and APIs support of the Objective-C SDK, this new SDK also adds the following new features:
- By default the datafile handler does updates every 10 minutes when the application is in the foreground. To disable this, set the periodicUpdateInterval to zero. If you do allow for polling, the project will update automatically when a new datafile change is received.
- On top of the above functionality, the developer may register for a datafile change notification. This notification will be called anytime a new datafile is downloaded to cache and is used to reinitialize the optimizely client automatically.
- The event handler batches events and will run every minute in the foreground to send events. If there are no events in the queue it will not reschedule.
May 30, 2019
This is the initial release of the Swift SDK. It is a pure Swift implementation which takes complete advantage of language features and performance. It supports Objective-C applications as well. It uses Swift 4.2 but we will be upgrading to 5.0 soon.
This modernized version of the SDK is meant to replace the Objective-C SDK.
- By default the datafile handler does updates every 10 minutes when the application is in the foreground. To disable this, set the periodicUpdateInterval to zero. If you do allow for polling, the project will update automatically when a new datafile change is received.
- On top of the above functionality, the developer may register for a datafile change notification. This notification will be called anytime a new datafile is downloaded to cache and is used to reinitialize the optimizely client automatically.
- The event handler batches events and will run every minute in the foreground to send events. If there are no events in the queue it will not reschedule.