Skip to content

Commit

Permalink
Merge branch 'development' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsetragni committed Sep 27, 2023
2 parents cb6895c + 98366a4 commit 9068cd9
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .dart_tool/package_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion .dart_tool/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.13.3
3.13.5
8 changes: 4 additions & 4 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
}
...
Expand Down Expand Up @@ -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
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
Expand All @@ -1118,6 +1125,8 @@ To enable precise alarms, you need to add the `SCHEDULE_EXACT_ALARM` permission
</manifest>
```

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
Expand Down
7 changes: 4 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.android.tools.build:gradle:7.3.0'
}
}

Expand All @@ -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
Expand All @@ -36,13 +36,14 @@ android {

defaultConfig {
minSdkVersion 21
targetSdk 34
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'

Expand Down
16 changes: 9 additions & 7 deletions coverage/lcov.info
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
}
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.7.5"
version: "0.7.6"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 9068cd9

Please sign in to comment.