- latest_ios_app_version = 2.1.0
- minimum_ios_app_version = 2.0.0
latest_android_app_version = 2.1.0 - minimum_android_app_version = 2.0.0
- force_update_message = Доступна более новая версия приложения! Пожалуйста, зайдите в магазин приложений и обновите!
У меня есть класс VersionChecker в котором я инициализирую удаленную конфигурацию следующим образом:
Код: Выделить всё
static Future initialize() async {
try {
final remoteConfig = FirebaseRemoteConfig.instance;
// Set configuration
await remoteConfig.setConfigSettings(
RemoteConfigSettings(
fetchTimeout: const Duration(minutes: 1),
minimumFetchInterval: Duration.zero,
),
);
// Fetch the values from Firebase Remote Config
bool fetchSuccess = await remoteConfig.fetchAndActivate();
if (!fetchSuccess) {
print('Failed to fetch and activate remote config');
}
// Add validation for empty values
final values = remoteConfig.getAll();
if (values.isEmpty) {
print('Warning: Remote config returned empty values');
}
print(
'Latest Android: ${remoteConfig.getString(LATEST_ANDROID_VERSION_KEY)}');
print('Min Android: ${remoteConfig.getString(MIN_ANDROID_VERSION_KEY)}');
print('Latest iOS: ${remoteConfig.getString(LATEST_IOS_VERSION_KEY)}');
print('Min iOS: ${remoteConfig.getString(MIN_IOS_VERSION_KEY)}');
return VersionChecker._(remoteConfig: remoteConfig);
} catch (e, stackTrace) {
print('Error initializing VersionChecker: $e');
print('Stack trace: $stackTrace');
rethrow;
}
}
Проблема, с которой я сталкиваюсь, заключается в следующем. что бы я ни пытался, удаленная конфигурация всегда не возвращает значений для этих строк.
Код: Выделить всё
W/Parcel ( 4201): Expecting binder but got null!
W/System ( 4201): Ignoring header If-None-Match because its value was null.
D/TrafficStats( 4201): tagSocket(144) with statsTag=0xffffffff, statsUid=-1
D/FRCPlugin( 4201): Sending fetchTimeout: 60
I/flutter ( 4201): Warning: Remote config returned empty values
I/flutter ( 4201): Latest Android:
I/flutter ( 4201): Min Android:
I/flutter ( 4201): Latest iOS:
I/flutter ( 4201): Min iOS:
D/EGL_emulation( 4201): app_time_stats: avg=27.50ms min=3.98ms max=145.80ms count=35
I/flutter ( 4201): Remote config values: {}
I/flutter ( 4201): Error comparing versions: FormatException: Invalid number (at character 1)
I/flutter ( 4201):
I/flutter ( 4201): ^
I/flutter ( 4201): Error comparing versions: FormatException: Invalid number (at character 1)
I/flutter ( 4201):
I/flutter ( 4201): ^
I/flutter ( 4201): Is lower than minimum: false
I/flutter ( 4201): Is lower than latest: false
I/flutter ( 4201): ====================================
I/flutter ( 4201): No update required
I/flutter ( 4201): NotificationsService: Initialized
D/ProfileInstaller( 4201): Installing profile for com.foundermatcha.foundermatcha
D/EGL_emulation( 4201): app_time_stats: avg=428.58ms min=36.59ms max=2092.93ms count=6
count=4
Я также прикрепил изображение моего RC в консоли Firebase, кажется, я установил это верно, но, возможно, проблема может быть именно в этом?

Любая помощь приветствуется, спасибо
Подробнее здесь: https://stackoverflow.com/questions/793 ... pplication
Мобильная версия