From 7137c937a7c584903f098c7c829d4eee8471c456 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Sat, 2 Mar 2024 21:24:54 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore=20::=20firebase=5Fremote=5Fconfig=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.lock | 24 ------------------------ pubspec.yaml | 1 - 2 files changed, 25 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 03656cd4..6c58accc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -193,30 +193,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.5.18" - firebase_remote_config: - dependency: "direct main" - description: - name: firebase_remote_config - sha256: "60fc92273d1db338a6fad1839c42dedc4ad64f812043acad0cbb200702f5c9ce" - url: "https://pub.dev" - source: hosted - version: "4.3.8" - firebase_remote_config_platform_interface: - dependency: transitive - description: - name: firebase_remote_config_platform_interface - sha256: "41813ef8dfbc40ef7a59a73f9e5acef2608dbcb2933241b6c03d52e90677040f" - url: "https://pub.dev" - source: hosted - version: "1.4.16" - firebase_remote_config_web: - dependency: transitive - description: - name: firebase_remote_config_web - sha256: "089e92f333c2fb2c05c640c80fecea9d1e06dada0ba85efe34a580987ef94a0a" - url: "https://pub.dev" - source: hosted - version: "1.4.16" flutter: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 6e685ccc..746958f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -53,7 +53,6 @@ dependencies: http: ^1.1.0 web_socket_channel: ^2.4.0 package_info_plus: ^4.2.0 - firebase_remote_config: ^4.3.8 dev_dependencies: From 3abe2dbbd281f9595e0daea065e90becd381adf6 Mon Sep 17 00:00:00 2001 From: yoochanhong Date: Sat, 2 Mar 2024 21:58:05 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix=20::=20=EC=9E=84=EC=8B=9C=EB=B0=A9?= =?UTF-8?q?=ED=8E=B8=EC=9C=BC=EB=A1=9C=20=EC=95=B1=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=84=9C=EB=B2=84=EC=97=90=EC=84=9C=20=EB=B0=9B=EC=95=84?= =?UTF-8?q?=EC=84=9C=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../splash_page/ui/view/splash_page.dart | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/presentation/splash_page/ui/view/splash_page.dart b/lib/presentation/splash_page/ui/view/splash_page.dart index ef179d38..4114c9cf 100644 --- a/lib/presentation/splash_page/ui/view/splash_page.dart +++ b/lib/presentation/splash_page/ui/view/splash_page.dart @@ -1,10 +1,11 @@ import 'dart:async'; +import 'dart:convert'; import 'dart:io'; -import 'package:firebase_remote_config/firebase_remote_config.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:http/http.dart' as http; import 'package:lotura/data/dto/request/get_apply_list_request.dart'; import 'package:lotura/presentation/app_update_page/ui/app_update_page.dart'; import 'package:lotura/presentation/apply_page/bloc/apply_bloc.dart'; @@ -13,6 +14,7 @@ import 'package:lotura/presentation/laundry_room_page/bloc/laundry_bloc.dart'; import 'package:lotura/presentation/laundry_room_page/bloc/laundry_event.dart'; import 'package:lotura/presentation/utils/bottom_navi.dart'; import 'package:lotura/presentation/utils/lotura_colors.dart'; +import 'package:lotura/secret.dart'; import 'package:package_info_plus/package_info_plus.dart'; class SplashPage extends StatefulWidget { @@ -26,16 +28,15 @@ class SplashPage extends StatefulWidget { class _SplashPageState extends State { Future checkAppVersion() async { - final remoteConfig = FirebaseRemoteConfig.instance; - await remoteConfig.fetchAndActivate(); - - String firebaseVersion = remoteConfig.getString( - Platform.isAndroid ? "ANDROID_APP_VERSION" : "iOS_APP_VERSION"); - PackageInfo packageInfo = await PackageInfo.fromPlatform(); String appVersion = packageInfo.version; - if (firebaseVersion != appVersion) { + final res = await http.get(Uri.parse( + "$baseurl/app_ver_${Platform.isAndroid ? "android" : "ios"}")); + + final newestAppVersion = jsonDecode(res.body)['version']; + + if (newestAppVersion != appVersion) { Future.delayed(Duration.zero).then((value) => Navigator.pushAndRemoveUntil( context,