From 75710aa9676528004892767bbe157c0468623465 Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Mon, 7 Oct 2024 10:27:20 +0200 Subject: [PATCH 1/6] fix: disable R8 full mode for flutter_local_notifications --- app/android/gradle.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/android/gradle.properties b/app/android/gradle.properties index 3b5b324f6..13d388045 100644 --- a/app/android/gradle.properties +++ b/app/android/gradle.properties @@ -1,3 +1,6 @@ org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true +# fixes flutter_local_notifications error +# https://github.com/MaikuB/flutter_local_notifications/issues/2223#issuecomment-1925452782 +android.enableR8.fullMode = false From cf1aac203c271e2ea8154d2a593574540f8eb351 Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Mon, 7 Oct 2024 11:00:24 +0200 Subject: [PATCH 2/6] fix: configure AndroidNotificationDetails correctly --- app/lib/util/schedule_notifications.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/lib/util/schedule_notifications.dart b/app/lib/util/schedule_notifications.dart index 9113b54db..9f72fac08 100644 --- a/app/lib/util/schedule_notifications.dart +++ b/app/lib/util/schedule_notifications.dart @@ -85,8 +85,15 @@ Future scheduleReminderForDate( return currentId; } -const notificationDetails = - NotificationDetails(android: AndroidNotificationDetails('0', 'StudyU')); +const notificationDetails = NotificationDetails( + android: AndroidNotificationDetails( + '0', + 'StudyU', + icon: "ic_notification", + priority: Priority.max, + importance: Importance.max, + ), +); Future scheduleNotifications(BuildContext context) async { if (StudyNotifications.debug) { From 5227105e9d283fef4ac89c4a4d6d0f44c648fa65 Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Mon, 7 Oct 2024 11:00:35 +0200 Subject: [PATCH 3/6] chore: show version in debug screen --- app/lib/util/debug_screen.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/lib/util/debug_screen.dart b/app/lib/util/debug_screen.dart index 98a53663e..2f6b97bee 100644 --- a/app/lib/util/debug_screen.dart +++ b/app/lib/util/debug_screen.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:path_provider/path_provider.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; @@ -12,7 +13,7 @@ import 'package:studyu_flutter_common/studyu_flutter_common.dart'; import 'package:url_launcher/url_launcher.dart'; class DebugScreen { - static void showDebugScreen(BuildContext context) { + static Future showDebugScreen(BuildContext context) async { final studyNotifications = context.read().studyNotifications; final pendingNotifications = studyNotifications != null @@ -26,7 +27,10 @@ class DebugScreen { bool? ignoreBatteryOptimizations; int? pendingNotificationRes; int? pendingNotificationsPluginRes; - + final packageInfo = await PackageInfo.fromPlatform(); + final versionString = + 'Version: ${packageInfo.version} - ${packageInfo.buildNumber}'; + if (!context.mounted) return; showDialog( context: context, builder: (_) => AlertDialog( @@ -35,6 +39,7 @@ class DebugScreen { ), content: Column( children: [ + Text(versionString), ElevatedButton( onPressed: () { AppConfig.getAppContact().then((value) { @@ -43,7 +48,8 @@ class DebugScreen { path: value.email, queryParameters: { 'subject': '[StudyU] Debug Information', - 'body': 'ignoreBatteryOptimizations: ${ignoreBatteryOptimizations ?? 'null'}\n' + 'body': 'version: $versionString\n' + 'ignoreBatteryOptimizations: ${ignoreBatteryOptimizations ?? 'null'}\n' 'pendingNotificationsNumber: ${pendingNotificationRes ?? 'null'}\n' 'pendingNotificationsPluginNumber: ${pendingNotificationsPluginRes ?? 'null'}\n' 'scheduledNotificationsDebug: ${StudyNotifications.scheduledNotificationsDebug}', From c374e7536b1b8ae71f3ea8ae64df1af2bd97cc09 Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Mon, 7 Oct 2024 11:20:39 +0200 Subject: [PATCH 4/6] fix: notification icon mipmap --- app/lib/util/schedule_notifications.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/util/schedule_notifications.dart b/app/lib/util/schedule_notifications.dart index 9f72fac08..5f12c5ae3 100644 --- a/app/lib/util/schedule_notifications.dart +++ b/app/lib/util/schedule_notifications.dart @@ -89,7 +89,7 @@ const notificationDetails = NotificationDetails( android: AndroidNotificationDetails( '0', 'StudyU', - icon: "ic_notification", + icon: '@mipmap/ic_launcher', priority: Priority.max, importance: Importance.max, ), From d05133e21dc5f7a3b0506738130db73ee75b55e7 Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Mon, 7 Oct 2024 11:35:41 +0200 Subject: [PATCH 5/6] fix: notification icon mipmap 2 --- app/lib/util/notifications.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/util/notifications.dart b/app/lib/util/notifications.dart index bca124296..a6616d107 100644 --- a/app/lib/util/notifications.dart +++ b/app/lib/util/notifications.dart @@ -166,7 +166,7 @@ class StudyNotifications { void _initNotificationsPlugin() { flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); const AndroidInitializationSettings initializationSettingsAndroid = - AndroidInitializationSettings('@drawable/ic_notification'); + AndroidInitializationSettings('@mipmap/ic_launcher'); final DarwinInitializationSettings initializationSettingsDarwin = DarwinInitializationSettings( onDidReceiveLocalNotification: ( From 331b576805fc2e997eeea3c9d4cc3fdecc7bf77d Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Mon, 7 Oct 2024 15:40:39 +0200 Subject: [PATCH 6/6] chore(release): publish packages - studyu_app@2.7.12 --- CHANGELOG.md | 24 ++++++++++++++++++++++++ app/CHANGELOG.md | 7 +++++++ app/pubspec.yaml | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c7816f26..ec5f593be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,30 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2024-10-07 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`studyu_app` - `v2.7.12`](#studyu_app---v2712) + +--- + +#### `studyu_app` - `v2.7.12` + + - **FIX**: notification icon mipmap 2. + - **FIX**: notification icon mipmap. + - **FIX**: configure AndroidNotificationDetails correctly. + - **FIX**: disable R8 full mode for flutter_local_notifications. + + ## 2024-10-03 ### Changes diff --git a/app/CHANGELOG.md b/app/CHANGELOG.md index be4e8a7ce..91a87eeed 100644 --- a/app/CHANGELOG.md +++ b/app/CHANGELOG.md @@ -1,3 +1,10 @@ +## 2.7.12 + + - **FIX**: notification icon mipmap 2. + - **FIX**: notification icon mipmap. + - **FIX**: configure AndroidNotificationDetails correctly. + - **FIX**: disable R8 full mode for flutter_local_notifications. + ## 2.7.11 - **FIX**: upgrade deps. diff --git a/app/pubspec.yaml b/app/pubspec.yaml index c6df2a083..70bab10c7 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -1,5 +1,5 @@ name: studyu_app -version: 2.7.11 +version: 2.7.12 description: Partake in digital N-of-1 trials with the innovative StudyU Health App publish_to: none homepage: https://studyu.health