When a user is in flight or airplane mode on their mobile device, LaunchDarkly will use the latest stored flag settings. When the user reconnects to a network, LaunchDarkly will reconnect to the stream to see if there are any new flag updates. This ensures that your users will always receive the most up-to-date flag settings, even if their devices are not currently connected to a network.
How do the mobile SDKs handle airplane/flight mode?
I’m seeing inconsistencies in iOS SDK flag evaluation
There are a few things to be aware of with the iOS SDK:
- The iOS SDK utilizes a streaming architecture to keep itself in sync with your configurations on the dashboard. If any change is made, these changes will be picked up by your iOS users the next time they get online.
- When the SDK receives any updates from LaunchDarkly they are cached to Core Data, so that the SDK can still evaluate flags even when offline.
- When a user first installs your app, until the first stream is established with LD, the default variation values will be used. There is a delegate pattern (see
userDidUpdate) that can be used to block until the first response is received.
- When a current user uses the app while offline, or if variation calls are made before the SDK has has finished initializing, then the SDK will continue to serve variations using the old state, and you may see these events show up occasionally in your dev console after making changes.
- If your SDK If you need to change your user, or you want to wait until the SDK has finished synchronizing with LaunchDarkly, you should use the
userDidUpdatedelegate to wait until the feature flags for the new user have been received.
Why is there a different mobile environment SDK key?
The server SDK keys are intended to be embedded in trusted environments. The mobile SDK keys are suitable for use in (untrusted) mobile clients. If a mobile user were to somehow decompile your app, or gain access to your mobile key, there is really no impact, as those keys can only access a restricted subset of our APIs that do not reveal any private data.