Releases: statsig-io/ios-sdk
v1.16.0 - Add methods for checking values without logging exposures
Adds:
checkGateWithExposureLoggingDisabled
andmanuallyLogGateExposure
getExperimentWithExposureLoggingDisabled
andmanuallyLogExperimentExposure
getConfigWithExposureLoggingDisabled
andmanuallyLogConfigExposure
getLayerWithExposureLoggingDisabled
andmanuallyLogLayerParameterExposure
v1.15.0 - Add ability to add StatsigListeners before calling Statsig.start
- Adding a listener via Statsig.addListener before calling Statsig.start will now add the listener in a 'pending' state. Once Statsig.start is called, the listeners will be added to the StatsigClient and all applicable events will be fired.
v1.14.0 - Add StatsigListening Protocol for User Value Changes
Adds the StatsigListening. This protocol allows you to listen for changes in the user value store.
There are two methods that can be implemented:
onInitialized
- Will be called when the initialize request is returned in
Statsig.start()
. - An error string may be passed to this function if something went wrong with the network request.
onUserUpdated
- Will be called when the network request for
Statsig.updateUser
is returned. - An error string may be passed to this function if something went wrong with the network request.
You then add your class that implements StatsigListening as a listener with:
Statsig.addListener(myListeningClass)
Note: If you call Statsig.addListener
after Statsig.start()
is already complete, the onInitialized
method will be called immediately.
Also adds Statsig.isInitialized()
which returns a boolean stating whether the Statsig.start()
call has returned.
These API changes will allow developers to know whether their Statsig instance is initialized.
ViewController Example
class ViewController: UIViewController, StatsigListening {
override func viewDidLoad() {
super.viewDidLoad()
if Statsig.isInitialized() {
render()
} else {
Statsig.addListener(self)
renderLoading()
}
}
private func render() {
var showNewUI = Statsig.checkGate("new_ui_enabled", false)
if showNewUI {
// Render the new
} else {
// Render the old
}
}
private func renderLoading() { /* Some Loading UI */ }
private func renderError(error: String) { /* Some Error UI */ }
// StatsigListening Implementation
func onInitialized(_ error: String?) {
if (error) {
renderError(error)
}
render()
}
func onUserUpdated(_ error: String?) { /* Optional rerender when User changed */ }
}
v1.13.1 - Lower log limit on tvOS
tvOS has far lower size limits for UserDefaults than iOS. Lowering from 1MB to 100KB for tvOS.
v1.13.0 - add support for tvOS
support tvos (#121)
v1.12.0 - Error Boundary
- Adds an error boundary around Statsig logic to prevent exceptions reaching client code and causing a crash. Errors are logged with Statsig to help diagnose problems.
- Refactors some InternalStore logic to remove force unwrapped variables
v1.11.0 - Cancel network request if initTimeout expires
Previously, timing out would just fire the callback early and overwrite Gate/Config/Layers when the initialize request returned. Now, when a timeout occurs, the request is cancelled and only cache or default values will be served.
v1.10.0 - evaluationDetails
- added
evaluationDetails
property toDynamicConfig
(Experiment) andLayer
classes. It has information on the reason for you to get the specific result. - the details also appear in the exposure event's details view under the Exposure Stream
v1.9.2 - bug fixes and improvements on Layers
-
Improved exposure logging when using Layers. Previously exposures for Layers happen when you call
getLayer()
, but when you have multiple experiments running in parallel in the same Layer, this could be exposing more users than the actual number of users who were actually exposed to some of the experiments, so with this release we have moved the exposure logic to be happening whenLayer.get()
method is called, so that a user is only exposed to an experiment when the parameter for that experiment is fetched. -
Fixed a bug on layer for sticky bucketing.
-
Made getLayer API thread safe.
v1.9.1 - bug fixes for keepDeviceValue
Fixed a bug where keepDeviceValue
parameter for getExperiment
and getLayer
wasn't working as intended in certain cases.