Skip to content

Releases: statsig-io/ios-sdk

v1.18.0 - Add macOS support

18 Jan 02:50
Compare
Choose a tag to compare

Adds compatibility with macOS 10.12+

v1.17.1 - Swift 5.5 Build Fix

05 Jan 02:31
4be31e3
Compare
Choose a tag to compare

Fixes an issue with type inference when compiling with Swift 5.5.

v1.17.0 - Adds Layer Overrides

28 Nov 18:25
Compare
Choose a tag to compare
  • Add ability to override values returned to getLayer calls.
  • Adds inline documentation for the Statsig interface

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.