forceVersionCheckWithFetch method
Force a version check with fresh Remote Config fetch (debug use only) This should only be used for debugging as it counts toward Firebase's 5 fetches/hour limit. Note: This is rarely needed now that onConfigUpdated works on all platforms including web.
Implementation
Future<void> forceVersionCheckWithFetch() async {
logv('đ Force checking version update WITH Remote Config fetch (debug only)');
// Try to fetch latest remote config if possible
try {
// Skip Firebase fetch if not initialized
if (!AppConfigBase.isFirebaseInitialized) {
logv('âšī¸ Firebase not initialized - using cached/default values only');
} else if (!AppConfigBase.doUseBackendEmulator ||
AppConfigBase.doOverrideUseLiveRemoteConfig) {
logv(
'â ī¸ Attempting to fetch latest Remote Config for force check (counts toward 5/hour limit)...');
await FirebaseRemoteConfig.instance.fetchAndActivate();
logv('â
Remote Config refreshed for force check');
} else if (AppConfigBase.doUseBackendEmulator &&
!AppConfigBase.doOverrideUseLiveRemoteConfig) {
logv('âšī¸ Using mock Remote Config - no fetch needed');
}
} catch (e) {
logv('â ī¸ Could not fetch remote config during force check (using cached values): $e');
// Continue with cached values - this is not a critical error
}
await checkVersionUpdate();
}