From b695b4ba8fb330882e93b0fd9d8bf0e844a647df Mon Sep 17 00:00:00 2001 From: Rafael Setragni Date: Tue, 26 Sep 2023 22:51:38 -0300 Subject: [PATCH 1/3] Upgrade Gradle and dependencies for Android 14 support In this commit, we've updated the Gradle version and package dependencies to ensure comprehensive support and smooth operation on Android 14 devices. --- .dart_tool/package_config.json | 4 ++-- .dart_tool/version | 2 +- .idea/workspace.xml | 16 +++++++++++++--- android/build.gradle | 7 ++++--- coverage/lcov.info | 16 +++++++++------- example/android/app/build.gradle | 4 ++-- example/android/build.gradle | 4 ++-- example/pubspec.lock | 6 +++--- example/pubspec.yaml | 2 +- pubspec.yaml | 2 +- 10 files changed, 38 insertions(+), 25 deletions(-) diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index b082c916..a2e7f8c3 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -416,7 +416,7 @@ "languageVersion": "2.19" } ], - "generated": "2023-09-22T23:21:52.866203Z", + "generated": "2023-09-27T00:22:33.347374Z", "generator": "pub", - "generatorVersion": "3.1.1" + "generatorVersion": "3.1.2" } diff --git a/.dart_tool/version b/.dart_tool/version index faedad41..3523e81f 100644 --- a/.dart_tool/version +++ b/.dart_tool/version @@ -1 +1 @@ -3.13.3 \ No newline at end of file +3.13.5 \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 042a88f2..a37579d9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -8,8 +8,18 @@ + + + + + + + + + + + - diff --git a/android/build.gradle b/android/build.gradle index 12f1fe1f..29b19924 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.3.0' } } @@ -27,7 +27,7 @@ android { if (project.android.hasProperty('namespace')) { namespace 'me.carda.awesome_notifications' } - compileSdkVersion 33 + compileSdkVersion 34 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -36,13 +36,14 @@ android { defaultConfig { minSdkVersion 21 + targetSdk testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } } dependencies { // implementation project(':awn_core') - implementation 'me.carda:AndroidAwnCore:0.7.5' + implementation 'me.carda:AndroidAwnCore:0.7.6' implementation 'com.google.guava:guava:31.1-android' diff --git a/coverage/lcov.info b/coverage/lcov.info index c2416290..9c14f10b 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -1283,17 +1283,19 @@ DA:54,2 DA:56,2 DA:60,1 DA:61,1 +DA:63,1 DA:64,1 -DA:66,3 DA:67,1 -DA:68,3 DA:69,3 -DA:72,1 -DA:73,4 +DA:70,1 +DA:71,3 +DA:72,3 DA:75,1 -DA:77,4 -LF:23 -LH:23 +DA:76,4 +DA:78,1 +DA:80,4 +LF:25 +LH:25 end_of_record SF:lib/src/utils/string_utils.dart DA:2,30 diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 09a6bb0f..4075bada 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -27,7 +27,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { namespace 'me.carda.awesome_notifications_example' - compileSdkVersion 33 //flutter.compileSdkVersion + compileSdkVersion 34 //flutter.compileSdkVersion ndkVersion flutter.ndkVersion compileOptions { @@ -41,7 +41,7 @@ android { // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion 21 //flutter.minSdkVersion - targetSdkVersion 33 //flutter.targetSdkVersion + targetSdkVersion 34 //flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/android/build.gradle b/example/android/build.gradle index 3cdaac95..f7eb7f63 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/pubspec.lock b/example/pubspec.lock index f5948201..a1efae6e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -31,7 +31,7 @@ packages: path: ".." relative: true source: path - version: "0.7.5" + version: "0.7.6" boolean_selector: dependency: transitive description: @@ -608,10 +608,10 @@ packages: dependency: "direct main" description: name: vibration - sha256: d81f665bcb201f586c295a21f3fe8f1cb6dc32c81a213a99e9c714ec8e811ce5 + sha256: ab6d26f6694ae0cf702b6d3d1b399570f2911eddb1132c8f82eeacb71a08ece2 url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.8.2" web: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 62df5410..a4f11507 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: shared_preferences: ^2.2.1 numberpicker: ^2.1.2 giff_dialog: ^1.0.1 - vibration: ^1.8.1 + vibration: ^1.8.2 device_info_plus: ^9.0.3 url_launcher: ^6.1.14 intl: ^0.18.1 diff --git a/pubspec.yaml b/pubspec.yaml index e98a5ffc..0dc482dd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: awesome_notifications description: A complete solution to create Local and Push Notifications, customizing buttons, images, sounds, emoticons and applying many different layouts for Flutter apps. -version: 0.7.5 +version: 0.7.6 repository: https://github.com/rafaelsetragni/awesome_notifications environment: From ce0546e3af2ddd041ef100ef0a307a30c62ab997 Mon Sep 17 00:00:00 2001 From: Rafael Setragni Date: Tue, 26 Sep 2023 22:53:02 -0300 Subject: [PATCH 2/3] Update CHANGELOG and README files In this commit, we've updated the CHANGELOG and README files to reflect recent changes and provide up-to-date project information to users and contributors. --- CHANGELOG.md | 7 +++++++ README.md | 29 +++++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea517283..4c9ca486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.7.6] +### Added +* Integration with awesome_notifications_core to automatically manage versions +* Support for Android 14 +### Improved +* Documentation updated + ## [0.7.5] ### Added * Full support for Flutter 3.13 diff --git a/README.md b/README.md index fd91a1f8..5f4c96c7 100644 --- a/README.md +++ b/README.md @@ -250,14 +250,22 @@ Bellow are the obligatory configurations that your app must meet to use awesome_ ### 🤖 Configuring Android: -1 - Is required the minimum android SDK to 21 (Android 5.0 Lollipop) and Java compiled SDK Version to 33 (Android 13). You can change the `minSdkVersion` to 21 and the `compileSdkVersion` and `targetSdkVersion` to 33, inside the file `build.gradle`, located inside "android/app/" folder. +1 - Is required the minimum android SDK to 21 (Android 5.0 Lollipop), Grade 7.3.0 or greater and Java compiled SDK Version to 34 (Android 14). You can change the `minSdkVersion` to 21 and the `compileSdkVersion` and `targetSdkVersion` to 34, inside the file `build.gradle`, located inside "android/app/" folder. ```Gradle +buildscript { + ... + + dependencies { + classpath 'com.android.tools.build:gradle:7.2.2' + } +} + android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 ... } ... @@ -1097,16 +1105,15 @@ await AwesomeNotifications().createNotification( ## ⏰ Schedule Precision -It's important to keep in mind that schedules can be ignored or delayed, especially for repeating schedules, due to system algorithms designed to save battery life and prevent abuse of resources. While this behavior is recommended to protect the app and the manufacturer's image, it's important to consider this fact in your business logic. - -However, for cases where precise schedule execution is a MUST requirement, there are some features you can use to ensure the execution at the correct time: +It's important to keep in mind that schedules can be ignored or delayed, especially for repeating schedules, due to system algorithms designed to save battery life and prevent abuse of resources. While this behavior is recommended to protect the app and the manufacturer's image, it's crucial to consider this fact in your business logic. -- Set the notification's category to a critical category, such as Alarm, Reminder, or Call. -- Set the `preciseAlarm` property to true. This feature allows the system to schedule notifications to be sent at an exact time, even if the device is in low-power mode. For Android versions greater than or equal to 12, you need to explicitly request user consent to enable this feature. You can request the permission with `requestPermissionToSendNotifications` or take the user to the permission page calling `showAlarmPage`. -- Set criticalAlerts channel property and notification content property to true. This feature allows you to show notifications and play sounds even when the device is on silent or Do Not Disturb mode. Due to its sensitivity, this feature requires special authorization from Apple on iOS and explicit user consent on Android versions greater than or equal to 11. On iOS, you must submit a request authorization to Apple to enable it, as described in [this post](https://medium.com/@shashidharyamsani/implementing-ios-critical-alerts-7d82b4bb5026). +However, for cases where precise schedule execution is a must, there are some features you can use to ensure the notification is sent at the correct time: +- Set the notification's category to a critical one, such as Alarm, Reminder, or Call. +- Set the `preciseAlarm` property to true. This feature allows the system to schedule notifications to be sent at an exact time, even if the device is in low-power mode. For Android versions greater than or equal to 12, you need to explicitly request user consent to enable this feature. You can request the permission with `requestPermissionToSendNotifications` or take the user to the permission page by calling `showAlarmPage`. +- Set the `criticalAlerts` channel property and notification content property to true. This feature allows you to show notifications and play sounds even when the device is on silent or Do Not Disturb mode. Due to its sensitivity, this feature requires special authorization from Apple on iOS and explicit user consent on Android versions greater than or equal to 11. On iOS, you must submit a request for authorization to Apple to enable it, as described in [this post](https://medium.com/@shashidharyamsani/implementing-ios-critical-alerts-7d82b4bb5026). -To enable precise alarms, you need to add the `SCHEDULE_EXACT_ALARM` permission to your app's `AndroidManifest.xml` file, which is located in the ***Android/app/src/main/*** folder: +To enable precise alarms, you need to add the `SCHEDULE_EXACT_ALARM` permission to your app's `AndroidManifest.xml` file, located in the ***Android/app/src/main/*** folder: ```xml ``` +For Android 14 or greater, the SCHEDULE_EXACT_ALARM permission is denied by default, and you must request it from the users using `requestPermissionToSendNotifications`. + To enable critical alerts, you need to add the `ACCESS_NOTIFICATION_POLICY` permission to your app's `AndroidManifest.xml` file: ```xml From be2bc2e1d1e9b2890d941349252293ddb143c550 Mon Sep 17 00:00:00 2001 From: Rafael Setragni Date: Tue, 26 Sep 2023 23:33:51 -0300 Subject: [PATCH 3/3] Set targetSdk on Android to 34 --- .idea/workspace.xml | 10 ---------- android/build.gradle | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a37579d9..beb65c2b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -8,18 +8,8 @@ - - - - - - - - - -