Skip to content

Releases: statsig-io/ios-sdk

1.49.0 - Typed completion error and custom URLs

10 Dec 00:52
af44eda
Compare
Choose a tag to compare

New Features

Typed callback errors

Statsig.start would call completion with an error string. We deprecated it in favor of Statsig.initialize. It improves error handling by calling completion with a StatsigClientError.

// New initializer
Statsig.initialize(sdkKey: "...") { (error: StatsigClientError?) in
    if let error = error {
        print(error.message)
        // Use error.code and error.cause to get more information on the error
    }
}

// Previous initializer (now deprecated)
Statsig.start(sdkKey: "...") { (error: String?) in
    if let error = error {
        print(error)
    }
}

Here's the interface for StatsigClientError:

public class StatsigClientError {
    public let code: StatsigClientErrorCode
    public let message: String
    public let cause: (any Error)?
}

And here's how to handle the different StatsigClientErrorCode error codes:

switch error.code {
    case .alreadyStarted:
    case .invalidClientSDKKey:
    case .initTimeoutExpired:
    case .clientUnstarted:
    case .failedToFetchValues:
}

Custom URLs

Endpoints for initialization and event logging could customized, but the SDK ignored the path from those URLs. To avoid breaking the existing behavior, we added two new options that overwrite the full URL:
initializationURL and eventLoggingURL.

// New option
Statsig.initialize(sdkKey: "...", options: StatsigOptions(initializationURL: URL(string: "https://example.com/setup")))
// Sends a request to https://example.com/setup

// Existing option
Statsig.initialize(sdkKey: "...", options: StatsigOptions(api: "https://example.com"))
// Sends a request to https://example.com/v1/initialize
// Doesn't support path customization

Improvements

More data on exposure events

  • rule passed for dynamic configs

Included In This Release

  • eec3c0a andre-statsig
    • Change StatsigClientError parent class from LocalizedError to Error (#315)
  • 7477f7f andre-statsig
    • Rename Url to URL (#314)
  • 1decf36 andre-statsig
    • Update tests (#316)
  • 00a0ef7 andre-statsig
    • Add passed field to exposures (#313)
  • 2cbe6fb andre-statsig
    • Reduce warnings (#312)
  • 44e206a andre-statsig
    • Support path components on custom URLs (#310)
  • 21e5cbb andre-statsig
    • Fix sample app (#311)
  • e8162f0 andre-statsig
    • Create separate methods that receive an error object (#308)

Full Changelog: 1.48.1...1.49.0

1.48.1 - Fix StorageProvider

09 Nov 01:27
985fbb6
Compare
Choose a tag to compare

Fixes

  • Make initialization consistently synchronous when passing a storageProvider

Included In This Release

  • c687a34 Weihao Ding
    • fix: make storage provider & initialize synchronous (#305)

Full Changelog: 1.48.0...1.48.1

1.48.0 - Customize Storage Provider

21 Oct 22:56
05dffe0
Compare
Choose a tag to compare

New Features

  • Introduced a new option in StatsigOptions called storageProvider which allows users to implement their own caching strategy by passing an object that conforms to the StorageProvider protocol.

Default cache key: com.statsig.cache

@objc public protocol StorageProvider {
    @objc func read(_ key: String) -> Data?
    @objc func write(_ value: Data, _ key: String)
    @objc func remove(_ key: String)
}

Included In This Release

  • c7fd742 Weihao Ding
    • feat: storage adapter (#303)

Full Changelog: 1.47.2...1.48.0

1.47.2 - Bootstrap Improvements

03 Oct 00:11
25cfda5
Compare
Choose a tag to compare

Improvements

  • Bootstrap Improvements
  1. Compare user objects instead of user hash to see if there is a mismatch
  2. Use the time from the bootstrapping response as the time
  3. Set fields from sdk info on exposures to know which sdk generated the bootstrap response

Fixes

  • Minor typo fixes.

Included In This Release

  • 24c0868 Weihao Ding
    • fix: ios bootstrap (#299)
  • 3a57101 Weihao Ding
    • chore: bootstrap improvements (#294)
  • 47216bf vmadhusudanan
    • minor typo in ios sdk (#298)

Full Changelog: 1.47.1...1.47.2

1.47.1 - Update Statsig Endpoints

21 Aug 02:06
460681d
Compare
Choose a tag to compare

Improvements

  • Old api endpoint is blockced by several ad blockers. Update to new api endpoint.

Included In This Release

  • 39b93db Weihao Ding
    • feat: change initialize and logEvent to use new domain (#296)

Full Changelog: 1.47.0...1.47.1

1.47.0 - Remove StatsigInternalObjC

12 Aug 23:22
af19280
Compare
Choose a tag to compare

Fixes

  • Remove StatsigInternalObjC - unused and causes build systems issues
    NOTE: this may require an update to your build in order to remove references to StatsigInternalObjC

Included In This Release

  • 55cace5 Daniel
    • chore: rm StatsigInternalObjC (#291)

Full Changelog: 1.46.0...1.47.0

1.46.0 - New API getFeatureGate, Fixes

19 Jul 23:26
ee0c395
Compare
Choose a tag to compare

New Features

  • Expose a new api getFeatureGate which will return a featureGate object to provide more details about the featureGate.

Improvements

  • Add more logging into diagnostics to understand about the overall initialize process and performance

Fixes

  • Correctly restart a paused EventLogger

Included In This Release

  • f05b5e2 Weihao Ding
    • logging: add more logging to understand cache step (#289)
  • 73e98d6 kenny-statsig
    • expose getFeatureGate API (#288)
  • 8372546 Daniel
    • fix: correctly restart a paused EventLogger (#287)

Full Changelog: 1.45.0...1.46.0

1.45.0 - New option to opt out non sdk metadata, ability to disable exposure for getParaStore func

01 Jul 22:17
0571fae
Compare
Choose a tag to compare

New Features

  • StatsigUser now has a new option called optOutNonSdkMetadata, which enable you to opt out nonSdkMetadata.

       note: if you enabled this option, it will only
        return [
                   "sdkType",
                   "sdkVersion",
                   "sessionID",
                   "stableID"
              ]
    
  • Add the ability to check a param store without logging any exposures.

Improvements

Fixes

Included In This Release

  • 3a324f0 Weihao Ding
    • fix: fix the unittest for opt out non sdk metadata (#285)
  • d756651 Weihao Ding
    • feat: add option to opt out non sdk metadata (#283)
  • 1f5be3c Daniel
    • feat: add disabled exposure getParamStore func (#282)

Full Changelog: 1.44.0...1.45.0

1.44.0 - Configurable Network Session

11 Jun 21:52
c54eea3
Compare
Choose a tag to compare

New

  • This Version added a new optional StatsigOption called urlSession. By default, it is set to URLSession.shared.This property can be customized to utilize URLSession instances with specific configurations, including certificate pinning, for enhanced security when communicating with servers.

Included In This Release

  • fb30551 Weihao Ding
    • Revert "feat: add support for getParameterStore" (#280)
  • 0a81ded Daniel
    • feat: add support for getParameterStore (#279)
  • c0fef62 Weihao Ding
    • feat: add URLSession into StatsigOptions (#278)

Full Changelog: 1.43.0...1.44.0

1.43.0 - Support Look Up Configs By Hashed Name, Support Nullable Strings in Layer/Config Getters, Expose Fields on ObjC Compat Classes

04 Jun 20:19
345133b
Compare
Choose a tag to compare

New:

  1. We now support passing in a hashed config name when calling those core apis. (e.g, checkGate(hashed name of the gate)

  2. Support Nullable Strings in Layer/Config Getters to make it consistent with other SDKs.

  3. Expose Fields on ObjC Compat Classes

Included In This Release

  • 8a3d147 Weihao Ding
    • feat: Look Up By Hashed Name First (#275)
  • c006ecb Daniel
    • feat: expose all fields on ObjC compat classes (#276)
  • 58eeab0 Daniel
    • feat: support nullable strings in getters (#274)

Full Changelog: 1.42.0...1.43.0