Remote Config Implementation for Dynamic Parameter Management
Remote Config—mechanism to deliver configuration parameters to mobile apps without App Store or Google Play updates. Differs from Feature Toggles: flags manage "what we show," Remote Config manages "how it works"—numbers, strings, URLs, JSON configurations.
What Remote Config Manages
- Limits and thresholds: max authorization attempts, HTTP request timeouts, minimum password length
- API endpoint URLs, CDN domains—region switching without release
- UI parameters: font size for certain markets, product count per row for different screen sizes
- Third-party SDK configuration: API keys, initialization parameters (non-secret)
- Messages and text needing urgent updates (not localization replacement, but emergency fixes)
Firebase Remote Config—Standard Implementation
Firebase Remote Config is most common. Parameters stored in Firebase Console, delivered via Google CDN with low latency (~50ms). SDK caches locally, uses cache next run, updates in background.
Critically important setting: fetch interval. Default 12 hours—reasonable for production (CDN cache, rate limit protection). For development: minimumFetchInterval = 0 in debug build. Lowering to 1 hour in production risks exceeding Firebase Remote Config quota (10,000 requests/day per project on free tier).
iOS:
let remoteConfig = RemoteConfig.remoteConfig()
let settings = RemoteConfigSettings()
settings.minimumFetchInterval = isDebug ? 0 : 3600
remoteConfig.configSettings = settings
// Set defaults from plist—mandatory
remoteConfig.setDefaults(fromPlist: "RemoteConfigDefaults")
// Fetch + activate with completion
remoteConfig.fetchAndActivate { status, error in
let timeout = remoteConfig["api_timeout_seconds"].numberValue.intValue
// Use value
}
Android (Kotlin):
val remoteConfig = Firebase.remoteConfig
remoteConfig.setDefaultsAsync(R.xml.remote_config_defaults)
remoteConfig.fetchAndActivate().addOnCompleteListener { task ->
val maxRetries = remoteConfig.getLong("max_auth_retries").toInt()
}
Default Values—Not Optional Detail
If Remote Config unavailable (first run offline, Firebase outage), app works with defaults. Without explicit defaults, SDK returns empty strings and zeros. api_timeout_seconds = 0—every request times out immediately.
Defaults on iOS—RemoteConfigDefaults.plist; Android—res/xml/remote_config_defaults.xml. These files in repo, updated with code. When adding new parameter—add default simultaneously.
Conditional Values (Conditions)
Remote Config supports targeting by: app version, country/region, device language, random user percentage. Allows:
- Enable new CDN endpoint only for European users
- Show special config for beta users (app version contains "beta")
- Gradually switch 10% of users to new feed algorithm
Custom Remote Config Service
Firebase not always suitable: can't send user data to Google, need custom targeting conditions, or require corporate IAM integration.
Minimal custom solution architecture:
- API endpoint
GET /api/config?appVersion=X&platform=ios®ion=eu—returns JSON parameters - Redis for cache with 5-minute TTL
- PostgreSQL for parameter and condition storage
- Webhook or WebSocket for instant cache invalidation on change
- Admin UI for non-technical staff
Client caches response in UserDefaults/SharedPreferences with timestamp. On launch—load cache instantly, background check for updates.
Timeline: Firebase Remote Config integration—1–2 days. Custom Config service with targeting and admin UI—2–3 weeks.







