launchdarkly / android-client-sdk

LaunchDarkly Client-side SDK for Android
Other
45 stars 23 forks source link

Get Actual values of Feature flags on first app launch #95

Closed akshaymanathkar closed 4 years ago

akshaymanathkar commented 4 years ago

Is your feature request related to a problem? Please describe. As per the documentation SDK will return fallback values for feature flags for first time app launch. I heard there was similar behavior on iOS and recently it got fixed by adding new function called "startCompleteWhenFlagsReceived". I was expecting something similar for Android SDK. Is it in pipeline? or is there a way to achieve this?

Describe the solution you'd like I would like to get actual feature flag values on first app launch since we are tracking some experiments before user signs up or logs in. based on these values we will be showing specific screens and fields to user

Describe alternatives you've considered N/A

Additional context Currently I am using SDK version 2.8.5 and planning to upgrade to 2.9.1

gwhelanLD commented 4 years ago

Hi @akshaymanathkar,

The Android SDK already gives you the ability to wait on initialization for a flag payload to be received. LDClient.init(Application, LDConfig, LDUser) returns a Future that will complete when the SDK has received flag values from LaunchDarkly. There is also LDClient.init(Application, LDConfig, LDUser, int startWaitSeconds) which will block up to startWaitSeconds waiting for an initial flag payload. These should provide the same functionality as the completion callback for startCompleteWhenFlagsReceived on iOS, although a callback interface is not provided in the Android SDK.

Hope this helps, @gwhelanLD