From 28451c09ddbf99e571470023f132e1cd9ccf6509 Mon Sep 17 00:00:00 2001 From: nano71 <80870408+nano71@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:11:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=84=E4=BB=B6=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/local.properties | 6 +++--- lib/common/service.dart | 13 ++++++------- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/android/local.properties b/android/local.properties index f9890d7..88cdc57 100644 --- a/android/local.properties +++ b/android/local.properties @@ -1,5 +1,5 @@ sdk.dir=C:\\sdk\\android-sdk flutter.sdk=C:\\sdk\\flutter -flutter.buildMode=debug -flutter.versionName=1.6.241009 -flutter.versionCode=64 \ No newline at end of file +flutter.buildMode=release +flutter.versionName=1.6.241010 +flutter.versionCode=65 \ No newline at end of file diff --git a/lib/common/service.dart b/lib/common/service.dart index af639fe..c404b12 100644 --- a/lib/common/service.dart +++ b/lib/common/service.dart @@ -1,19 +1,18 @@ import 'package:workmanager/workmanager.dart'; - import 'homeWidget.dart'; -@pragma('vm:entry-point') // Mandatory if the App is obfuscated or using Flutter 3.1+ +@pragma('vm:entry-point') void callbackDispatcher() { Workmanager().executeTask((task, inputData) async { print("执行任务: $task"); - // 在这里处理你的后台任务逻辑 + try { await backstageRefresh(); - } catch (err) { - print('callbackDispatcher: ' + err.toString()); - throw Exception(err); + } catch (error) { + print('callbackDispatcher: ' + error.toString()); + throw Exception(error); } - // 返回 true 代表任务成功,false 代表任务失败 + return Future.value(true); }); } diff --git a/pubspec.yaml b/pubspec.yaml index 31357f5..3411167 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "https://pub.flutter-io.cn" # Remove this line if you wish to publis # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.6.241009+64 +version: 1.6.241010+65 environment: sdk: ">=2.14.0 <4.0.0"