Skip to content

Releases: statsig-io/ios-sdk

v1.16.0 - Add methods for checking values without logging exposures

14 Oct 21:34
Compare
Choose a tag to compare

Adds:

  • checkGateWithExposureLoggingDisabled and manuallyLogGateExposure
  • getExperimentWithExposureLoggingDisabled and manuallyLogExperimentExposure
  • getConfigWithExposureLoggingDisabled and manuallyLogConfigExposure
  • getLayerWithExposureLoggingDisabled and manuallyLogLayerParameterExposure

v1.15.0 - Add ability to add StatsigListeners before calling Statsig.start

17 Sep 00:53
Compare
Choose a tag to compare
  • 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

26 Aug 01:47
Compare
Choose a tag to compare

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

02 Aug 22:53
Compare
Choose a tag to compare

tvOS has far lower size limits for UserDefaults than iOS. Lowering from 1MB to 100KB for tvOS.

v1.13.0 - add support for tvOS

09 Jun 19:27
89e93c9
Compare
Choose a tag to compare
support tvos (#121)

v1.12.0 - Error Boundary

24 May 20:37
Compare
Choose a tag to compare
  • 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

18 May 20:41
Compare
Choose a tag to compare

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

06 May 19:06
Compare
Choose a tag to compare
  • added evaluationDetails property to DynamicConfig (Experiment) and Layer 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

21 Apr 20:54
f022372
Compare
Choose a tag to compare
  • 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 when Layer.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

24 Mar 06:45
efcccdb
Compare
Choose a tag to compare

Fixed a bug where keepDeviceValue parameter for getExperiment and getLayer wasn't working as intended in certain cases.