Releases: statsig-io/ios-sdk
1.49.0 - Typed completion error and custom URLs
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
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
New Features
- Introduced a new option in
StatsigOptions
calledstorageProvider
which allows users to implement their own caching strategy by passing an object that conforms to theStorageProvider
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
Improvements
- Bootstrap Improvements
- Compare user objects instead of user hash to see if there is a mismatch
- Use the time from the bootstrapping response as the time
- Set fields from sdk info on exposures to know which sdk generated the bootstrap response
Fixes
- Minor typo fixes.
Included In This Release
Full Changelog: 1.47.1...1.47.2
1.47.1 - Update Statsig Endpoints
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
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
New Features
- Expose a new api
getFeatureGate
which will return afeatureGate
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
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
New Features
-
StatsigUser
now has a new option calledoptOutNonSdkMetadata
, 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
Full Changelog: 1.44.0...1.45.0
1.44.0 - Configurable Network Session
New
- This Version added a new optional
StatsigOption
calledurlSession
. By default, it is set toURLSession.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
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
New:
-
We now support passing in a hashed config name when calling those core apis. (e.g, checkGate(hashed name of the gate)
-
Support Nullable Strings in Layer/Config Getters to make it consistent with other SDKs.
-
Expose Fields on ObjC Compat Classes
Included In This Release
Full Changelog: 1.42.0...1.43.0