Skip to content

Feature flags in iOS and Android apps: SDKs compared, caching, offline and old app versions

How feature flags work in native mobile apps: the iOS and Android SDKs of 12 tools with versions, minimum OS, where flags are evaluated and whether values survive a restart, plus first launch, background behavior, login, old app versions and a tested OpenFeature Swift example.

12 min read

Short answer: Mobile flag SDKs fetch flag values for the current user, keep them on the device, and read them locally, so checks work offline. Plan for three things web apps don't have: a first launch with no cached values, apps that stop updating in the background, and old app versions that stay installed for years with whatever default you compiled in.

Which iOS and Android SDKs are there?

Versions from each SDK's GitHub releases (iOS) and Maven Central or Google's Maven repository (Android), checked on 15 November 2026. Minimum OS versions are from each vendor's docs, checked against the SDK's Package.swift or podspec and the AndroidManifest.xml in the published Android library; where they differ we use the published files.

Tool iOS SDK Android SDK Where flags are evaluated Values kept across restarts
LaunchDarkly ios-client-sdk 11.8.0, iOS 15+ (SPM, CocoaPods, Carthage) launchdarkly-android-client-sdk 5.18.0, API 21+ Values for one context, sent to the device Yes, by default (last 5 contexts)
Firebase Remote Config firebase-ios-sdk 13.2.0, iOS 15+ firebase-config 24.0.1 (BoM 35.2.0), API 24+ Fetched values for the app instance Yes, previously fetched values can be activated at startup
ConfigCat swift-sdk 11.3.1, iOS 12+ configcat-android-client 11.0.0, API 21+ On the device, from the downloaded config iOS: yes, in UserDefaults by default; Android: memory only unless you add SharedPreferencesCache
Flagsmith flagsmith-ios-client 3.11.0, iOS 12+ flagsmith-kotlin-android-client 1.10.0 Values per identity from the API Off by default; opt-in cache to permanent storage
Unleash unleash-ios-sdk 2.5.2, iOS 12+ unleash-android 3.3.4, API 21+ By Unleash or Unleash Edge, for the given context Android: last state on disk, reused for the same context; iOS: in memory unless you supply a StorageProvider
Statsig statsig-kit 1.62.9, iOS 10+ android-sdk 5.1.6 Values for the user, fetched from Statsig Yes (UserDefaults or file on iOS, disk on Android)
PostHog posthog-ios 3.97.2, iOS 13+ posthog-android 3.77.1, API 23+ By PostHog, for the identified user Yes
DevCycle ios-client-sdk 1.26.0, iOS 12+ android-client-sdk 2.9.3, API 26+ By DevCycle's client SDK API Config cache on by default (30-day TTL)
Split / Harness FME ios-client 3.8.1, iOS 15+ (raised in 3.8.0) android-client 5.5.3, API 19+ On the device Yes, stored after the first initialization
Optimizely swift-sdk 6.1.0, iOS 15+ (SPM only) android-sdk 5.5.0, API 21+ On the device, from a downloaded datafile The datafile is cached on disk (in the SDK source; the docs don't say)
GrowthBook growthbook-swift 2.0.2, iOS 12+ io.growthbook.sdk:GrowthBook 10.1.1, API 21+ On the device by default; remote evaluation optional iOS: yes, persisted to disk; Android: caching on by default
OpenFeature swift-sdk 0.7.0, iOS 15+ (alpha) dev.openfeature:kotlin-sdk 0.9.0, API 21+ Depends on the provider Depends on the provider

Sources: LaunchDarkly iOS, LaunchDarkly Android and local storage; Firebase Remote Config for Apple and Android, loading strategies; ConfigCat iOS and Android; Flagsmith iOS and Android; Unleash iOS and Android; Statsig iOS and Android; PostHog iOS and Android; DevCycle iOS, Android and SDK features; Harness FME iOS and Android; Optimizely Swift and Android; GrowthBook Swift and Kotlin; OpenFeature Swift and Kotlin. Minimums and caches not in the docs: LaunchDarkly podspec, Split iOS changelog, the Optimizely Android and Firebase Remote Config Android libraries, the Firebase Remote Config podspec, and the Unleash Android, Unleash iOS and Optimizely Swift source.

Other tools with mobile SDKs include Eppo (eppo-ios-sdk 5.3.4, cloud.eppo:android-sdk 4.12.2), Amplitude Experiment and Datadog Feature Flags. Most of these vendors also publish React Native and Flutter SDKs, which wrap the same ideas: cached values, a ready event and an identify call. AWS AppConfig is aimed at server-side reads through its agent or API, not at apps calling it directly.

Where are mobile flags evaluated, and what does that expose?

Two models, with different trade-offs:

  • Values evaluated for one user (LaunchDarkly, Unleash, PostHog, Statsig, Flagsmith, DevCycle): the device sends the user's attributes and receives that user's results. Targeting rules stay on the server, but the attributes you use for targeting leave the device; account for that in your privacy policy and Apple privacy manifest.
  • Rules downloaded to the device (ConfigCat, Split's standard SDKs, Optimizely's datafile, GrowthBook by default): evaluation needs no per-user request and works for new users offline, but anyone can extract the rules and flag names from the app. GrowthBook's Swift SDK supports remote evaluation if that matters.

Mobile SDK keys are shipped inside the app, so treat them as public: they should only read flags, never change them. And as on the web, a flag isn't a permission check; enforce access on your server (entitlements vs feature flags).

What happens on the first launch, and offline?

After the first successful fetch, most SDKs read cached values at startup and work offline. The first launch is the hard case: there is no cache, so checks return the default you pass in code until flags arrive. The options the SDKs give you:

SDK Wait for flags, with a timeout Before flags load
LaunchDarkly iOS start(config:context:startWaitSeconds:), 5 seconds or less advised; Android init(app, config, context, timeout), where the docs recommend 0 (use cached values, don't block the main thread) and at most 5 seconds Cached values for that context, else your default
ConfigCat iOS waitForReady(); maxInitWaitTimeInSeconds (iOS) or maxInitWaitTimeSeconds (Android), 5 by default Your default if the cache is empty
Statsig initTimeout (iOS), initTimeoutMs (Android) Cached values from the last session, else your default
Split / Harness FME SDK_READY, SDK_READY_FROM_CACHE and SDK_READY_TIMED_OUT events The control treatment
Unleash ready event (iOS), isReady() and a ready listener (Android) Default value (often false); bootstrap values if given
DevCycle onInitialized callback, or await the builder on iOS Your default
PostHog onFeatureFlags callback; bootstrap config to seed values Not enabled, except on later launches with stored flags
Firebase Remote Config The fetchAndActivate completion Your in-app defaults
OpenFeature setProviderAndWait, with no timeout of its own (example below) Your default

Firebase's loading strategies describe the common pattern: activate the values fetched in a previous session at startup, fetch new ones in the background, and apply them on the next launch, so the UI doesn't change while someone is using it. Its default minimum fetch interval is 12 hours (fetches inside that window are throttled); real-time updates through addOnConfigUpdateListener bypass it.

Two rules for defaults: pick the value most users should see if flags never load (usually the old, safe behavior), and if a screen must not flash, show a short loading state with a timeout rather than waiting indefinitely.

Do flags update while the app is in the background?

Mostly not, which saves battery but means a backgrounded app catches up when it returns:

  • LaunchDarkly iOS: no real-time events while backgrounded, and no background fetch on iOS.
  • Statsig iOS: shuts down when the app enters the background unless you set shutdownOnBackground to false.
  • DevCycle iOS: closes its server-sent events connection in the background and requests a new configuration on foreground.
  • Split / Harness FME: streams in the foreground by default, falling back to polling; background sync (synchronizeInBackground) is off by default.
  • GrowthBook Swift: doesn't poll in the background; call refreshCache() at natural points such as returning to the foreground.
  • Split / Harness FME Android: with synchronizeInBackground on, it syncs through WorkManager every 15 minutes.
  • Polling defaults: ConfigCat every 60 seconds, Unleash iOS every 15 seconds and Android every 60 seconds (in the Android SDK's code), Split's polling fallback every 3,600 seconds. PostHog fetches on each app open.

If a kill switch must take effect within minutes, check the SDK's foreground behavior, not only its streaming option.

How do I switch users after login?

Call the SDK's identify method so flags are fetched (or evaluated) for the new user, and its reset method on logout where one exists. Logout entries in italics are our suggestion where the docs give none:

SDK Login Logout
LaunchDarkly identify(context) identify with an anonymous context (give each one a unique key, or let the SDK generate it)
Statsig updateUserWithResult (iOS), updateUser / updateUserAsync (Android) Update to a user without a user ID (Statsig keeps its device-level stable ID)
PostHog identify(distinctId) reset()
DevCycle identifyUser(user) resetUser()
Unleash updateContext(context:) (iOS), setContext (Android) Set a context without a user ID
ConfigCat setDefaultUser(user) clearDefaultUser()
GrowthBook setAttributes(...) (replaces all attributes, per the Kotlin docs) setAttributes without the user ID
Flagsmith, Optimizely Pass the user with each call Stop passing it
OpenFeature setEvaluationContext(...) Set an anonymous context

LaunchDarkly loads cached values for the new context first, then fetches; values for a user who has never logged in on that device start from defaults.

How do I use OpenFeature on iOS?

OpenFeature's mobile SDKs use a static context: one context for the whole app, replaced on login, with the provider re-fetching or re-evaluating. Below is a small store a SwiftUI view can observe. We compiled it with swift-sdk 0.7.0 in Swift 6 language mode (strict concurrency) and ran it on macOS with the in-memory provider standing in for a real one: before the provider was ready it reported isReady false, then false for the anonymous user, then true after logging in a "pro" user.

import Combine
import Foundation
import OpenFeature

@MainActor
final class FlagStore: ObservableObject {
    @Published private(set) var isReady = false
    @Published private(set) var newCheckout = false
    private var cancellables = Set<AnyCancellable>()

    func start(makeProvider: @escaping @Sendable () -> FeatureProvider, anonymousID: String) {
        OpenFeatureAPI.shared.observe()
            .receive(on: DispatchQueue.main)
            .sink { [weak self] event in
                switch event {
                case .ready, .contextChanged, .configurationChanged:
                    self?.refresh()
                    self?.isReady = true
                default:
                    break
                }
            }
            .store(in: &cancellables)

        // Don't block launch: show defaults, stop waiting after 2 seconds
        Task { [weak self] in
            try? await Task.sleep(nanoseconds: 2_000_000_000)
            self?.isReady = true
        }
        Task { await Self.connect(makeProvider: makeProvider, id: anonymousID) }
    }

    func logIn(userID: String, plan: String) async {
        await Self.setUser(id: userID, plan: plan)
        refresh()
    }

    private func refresh() {
        newCheckout = OpenFeatureAPI.shared.getClient()
            .getBooleanValue(key: "new-checkout", defaultValue: false)
    }

    // The SDK's context and provider types aren't Sendable: create them off the main actor
    private nonisolated static func connect(makeProvider: @Sendable () -> FeatureProvider, id: String) async {
        await OpenFeatureAPI.shared.setProviderAndWait(provider: makeProvider(), initialContext: context(id: id, plan: "free"))
    }

    private nonisolated static func setUser(id: String, plan: String) async {
        await OpenFeatureAPI.shared.setEvaluationContextAndWait(evaluationContext: context(id: id, plan: plan))
    }

    private nonisolated static func context(id: String, plan: String) -> EvaluationContext {
        ImmutableContext(targetingKey: id, structure: ImmutableStructure(attributes: ["plan": .string(plan)]))
    }
}

Create one store for the app (for example as a @StateObject in your App), call start from the root view's .task, and show a loading state while isReady is false. Notes from building it:

  • Events arrive on a background queue. observe() delivers events on the SDK's own serial queue, so hop to the main queue (receive(on:)) before updating published values.
  • No timeout of its own. setProviderAndWait waits until the provider is ready, however long that takes; the store above stops waiting for the UI after 2 seconds and picks up values when the ready event arrives. While a new context is applied after login, providers can emit reconciling.
  • Swift 6 strict concurrency. Passing a provider or an EvaluationContext from @MainActor code into the SDK's async methods failed to compile ("sending value of non-Sendable type 'any EvaluationContext' risks causing data races"), and @preconcurrency import didn't help; creating them in nonisolated functions, as above, did. In Swift 5 language mode the simpler direct calls compile.
  • A stable anonymous ID. Generate a random ID once and store it on the device; a fixed or shared anonymous key breaks percentage rollouts.
  • Compiler version. The README says the SDK "is built with Swift 5.5+", but 0.7.0 failed to compile with Swift 5.10: it uses trailing commas in parameter lists, which arrived in Swift 6.1 (SE-0439). It built with Swift 6.4.2; use Xcode 16.3 or later (Swift 6.1).
  • Alpha. Both the Swift and the Kotlin SDKs are marked alpha (Swift, Kotlin).
  • Android. The Kotlin SDK (Kotlin Multiplatform: Android, JVM, iOS and Linux native, JS for Node.js and browsers) works the same way with OpenFeatureAPI.setEvaluationContext, but ships no in-memory provider, and the contrib OFREP provider (0.1.0 in kotlin-sdk-contrib) wasn't on Maven Central when we checked, so we didn't publish an Android example.

What changes because old app versions stay installed?

On the web, everyone runs the latest code after a deploy. In mobile, some users run versions from months or years ago, and you can't change their code.

  • The compiled default is permanent for that version. If you delete a flag in the dashboard, old versions fall back to the default in their code. Archive flags only when no supported app version still reads them, or keep them returning the final value.
  • Target by app version. Send the app version as a context attribute, so you can turn a feature off for one buggy release without touching the others.
  • Kill switches need a cache plan. A user offline since before you flipped the switch keeps the cached value until the next fetch, and some SDKs only fetch on launch or foreground.
  • Flagged features and App Review. Guideline 2.5.2 says apps may not download code that introduces or changes features, so flags can only switch between code already in the reviewed binary. Guideline 2.5.19 forbids "hidden, dormant, or undocumented features", and 2.3.1(a) asks you to describe new features in the Notes for Review and make them accessible for review: describe features that ship behind a flag and let the reviewer reach them (App Review Guidelines).
  • A minimum-version flag. A flag holding the oldest supported app version lets you prompt users of broken releases to update.
  • Clean up in code too. Remove flag checks in a later release and keep the flag in the dashboard until old versions age out (see stale feature flags).

What else should I check?

  • Package managers. CocoaPods trunk becomes permanently read-only on 2 December 2026; existing builds keep working, but new SDK releases will only ship through Swift Package Manager (CocoaPods). GrowthBook's last CocoaPods release is 1.3.4, and Optimizely has already removed CocoaPods support.
  • Minimum OS. LaunchDarkly, Split, Optimizely, Firebase and OpenFeature need iOS 15; on Android, DevCycle and Eppo need API 26, Firebase Remote Config API 24 and PostHog API 23, and the others API 21 or lower.
  • Experiment exposures. With experimentation SDKs such as Statsig, Split, Optimizely and LaunchDarkly, checking a flag usually logs an exposure. Check flags where the feature is shown, not all at once at launch, or users who never saw the feature end up in the results.
  • Privacy. Targeting attributes sent to a vendor count as data collection: cover them in your consent flow and App Store privacy details, and check each SDK's privacy manifest (OpenFeature's Swift SDK ships one).
  • Testing. Use the in-memory provider or the vendor's offline or bootstrap mode for tests and debug builds, and add a debug menu to override flags locally.
  • Remote config vs flags. Firebase Remote Config is free and common in apps; it targets with conditions such as app version, Analytics user properties or audiences, or custom signals rather than an identify call per user, and its fetch interval is coarse by default; see remote config vs feature flags.

For the web, see feature flags in React; for servers, Node.js, Python, Go and Java. To pick a tool, see the best feature flag tools or the directory.