Supported on: iOS SDK
1.0.61+ · Android SDK 1.0.33+ · Flutter SDK 1.0.3+Get a Config Value
get returns Future<dynamic> — the value type matches whatever you configured in the Console (string, number, boolean, or JSON map). Cast to the type you expect and supply a fallback for the null case.
Reading Other Types
Get All Values
getAll returns a Map<String, dynamic> containing every key the SDK currently has cached.
Force a Refresh
refresh pulls the latest config from the server. The SDK already refreshes automatically (see below) — call this explicitly only when you need fresh values right now (e.g. after a user changes their preferences in another tab).
Module Access
Module Methods
Typed Helpers
If you prefer typed accessors at the call site, add a Dartextension on the module. This keeps the SDK surface small while giving your codebase a typed feel.
When Config Refreshes
The SDK refreshes remote config automatically:- At
configure— once the bootstrap succeeds, the native SDK fetches the config, whatever the cache’s age. If the bootstrap failed (for example, offline at launch), the fetch runs when a retry of the bootstrap succeeds — the SDK retries it when the network comes back, on foreground and after a backoff (Offline-first). - When the TTL elapses — after each successful fetch the native SDK fetches again once the config is older than the TTL (default 1 hour)
- On Android, in the background — a WorkManager job fetches every 15 minutes while the device is online; it skips a run when the SDK is not configured in that process
AppDNA.remoteConfig.refresh() (or AppDNA.forceRefreshConfig()) fetches at once, bypassing the TTL.
If the fetch fails, the SDK continues using cached values. On first launch with no connectivity, bundled config defaults are used.
The config TTL is configurable via
AppDNAOptions(configTTL: 7200) (in seconds). When you do not set it, the value the server returns with the SDK’s bootstrap request applies once the bootstrap succeeds, if it is positive; otherwise 3600 seconds (1 hour).Listen for Config Changes
onChanged fires after each config fetch from the server, whether or not a value changed: on iOS once per successful fetch, on Android once or more per fetch. Re-read the keys you care about inside the callback.
Full Example
Remote config values are managed in the Console under Settings → SDK → Config Bundle, in the Remote Config card (Add Flag, then Save & Sync). Changes take effect on the next SDK config refresh.

