A question of the day iOS app to demonstrate realtime remote configuration changes in Firebase.
- Written in CleanSwift architecture
- Validates realtime question and answer of the day
- A
RemoteConfigurationWorker.swift
that wrapsFirebaseRemoteConfig
singleton object and to decouple from app's code
- Default values can be configured using
.plist
file - Configs fetched needs to be activated before it can be used. Otherwise it will fallback to default values specified
- There are 2 functions to fetching remote configurations from Firebase:
fetch(completionHandler:)
- Caches values on first successful request
- Caches invalidate itself after 12 hours
fetch(withExpirationDuration:completionHandler:)
- Invalidates caches when expiry duration exceeded and will fetch directly from Firebase RemoteConfig
- Caching invalidation & direct fetching are limited to 5 times every 60 minutes per app
- Afterwards, it will continue using cache until the next hour to prevent app from spamming calls to Firebase RemoteConfig
- Caching and throttling happens in app's SDK
- Workarounds to caching and throttling:
- Delete and reinstall app, or
- Switch
developerMode
totrue
:let remoteConfig = RemoteConfig.remoteConfig() let remoteConfigSettings = RemoteConfigSettings(developerModeEnabled: true) remoteConfig.configSettings = remoteConfigSettings