statsig-io / ios-sdk

Statsig's SDK for client-side iOS applications.
ISC License
15 stars 8 forks source link

Calling `Statsig.addListener(_:)` before calling `start` fails silently. #1

Closed schrismartin-eb closed 2 years ago

schrismartin-eb commented 2 years ago

Using Statsig.addListener should give the ability for the listener to receive lifecycle events, including the onInitialized(_:) event. Currently, when the addListener(_:) call is made before the start call is, adding the listener fails silently.

https://github.com/statsig-io/ios-sdk/blob/24875a949c4e1ac25917b5d4fc95c11ca37eadbc/Sources/Statsig/Statsig.swift#L43-L46

I would like to be able to call addListener(_:) long before the start call in order to receive these events, but that doesn't seem possible right now. Is this something you'd be willing to consider adding?

Thanks!

daniel-statsig commented 2 years ago

This seems reasonable. Let me add this and get back to you...

daniel-statsig commented 2 years ago

Ok, this has now been added. Version is 1.15.0. Sorry it took so long.

https://github.com/statsig-io/ios-sdk/releases/tag/v1.15.0