PostHog / posthog-ios

PostHog iOS SDK
https://posthog.com/docs/libraries/ios
MIT License
32 stars 41 forks source link

adds PHGPostHogFeatureFlagsDidLoadNotification #33

Closed chrisladd closed 10 months ago

chrisladd commented 1 year ago

Big fan, first time caller. I'm starting to use PostHog's experiments, and wanted an easy way to know which group users fell into. In my testing, all users were control at launch, and then were assigned to their groups some time later as data is fetched from the server.

What does this PR do?

Allows clients to delay checking for feature flags until they've loaded, as well as listen for relevant updates.

I tried to fit in with the current style of the project, but am glad to make any stylistic changes.

Where should the reviewer start?

How should this be manually tested?

On launch, or after calling reloadFeatureFlags, clients should expect the PHGPostHogFeatureFlagsDidLoadNotification.

Any background context you want to provide?

Questions:

What are the relevant tickets?

Screenshots or screencasts (if UI/UX change)

Questions:

Perhaps—if you all agree with the change, it would be useful to let clients know to listen.

benjackwhite commented 1 year ago

Just noticed this (we had few eyes on this repo as Christmas approached and passed). I'm working on this SDK atm so will check this out ASAP and get it in as it looks good at a glance 👍

marandaneto commented 10 months ago

Closed because of the new major version that should have addressed this use case (via callback and/or notification) https://github.com/PostHog/posthog-ios/pull/75