refreshRemoteConfig method
Refresh & update cache
Implementation
Future<void> refreshRemoteConfig() async {
try {
await _remoteConfig.fetchAndActivate();
await _persistAllToCache();
_remoteConfig.onConfigUpdated.listen((event) async {
debugPrint("Remote Config updated: ${event.updatedKeys}");
await _remoteConfig.fetchAndActivate();
await _persistAllToCache();
});
} catch (e) {
debugPrint("RC refresh error: $e");
}
}