Skip to content

Commit 3965b4f

Browse files
committed
Merge branch 'master' into windows-notifications-worker-thread
Resolve conflicts with MaikuB#2801: initialization takes groupName and stores the group on the worker thread; show, schedule, update, cancel and getActiveNotifications use the group and aumid for apps without package identity. The cached ToastNotificationHistory is dropped as on master; each worker job calls ToastNotificationManager::History().
2 parents 316ec35 + 0c746dd commit 3965b4f

64 files changed

Lines changed: 1816 additions & 344 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/validate.yml‎

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: subosito/flutter-action@v2
2525
with:
2626
channel: stable
27-
flutter-version: 3.38.1
27+
flutter-version: 3.44.0
2828
cache: true
2929
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
3030
- name: Install Tools
@@ -67,7 +67,7 @@ jobs:
6767
- name: Build
6868
run: melos run build:example_android
6969
build_example_android_min_flutter:
70-
name: Build Android example app (3.38.1)
70+
name: Build Android example app (3.44.0)
7171
runs-on: ubuntu-latest
7272
steps:
7373
- uses: actions/checkout@v7
@@ -78,7 +78,7 @@ jobs:
7878
- uses: subosito/flutter-action@v2
7979
with:
8080
channel: stable
81-
flutter-version: 3.38.1
81+
flutter-version: 3.44.0
8282
cache: true
8383
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
8484
- name: Install Tools
@@ -100,14 +100,14 @@ jobs:
100100
- name: Build
101101
run: melos run build:example_ios
102102
build_example_ios_min_flutter:
103-
name: Build iOS example app (3.38.1)
103+
name: Build iOS example app (3.44.0)
104104
runs-on: macos-latest
105105
steps:
106106
- uses: actions/checkout@v7
107107
- uses: subosito/flutter-action@v2
108108
with:
109109
channel: stable
110-
flutter-version: 3.38.1
110+
flutter-version: 3.44.0
111111
cache: true
112112
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
113113
- name: Install Tools
@@ -129,14 +129,14 @@ jobs:
129129
- name: Build
130130
run: melos run build:example_macos
131131
build_example_macos_min_flutter:
132-
name: Build macOS example app (3.38.1)
132+
name: Build macOS example app (3.44.0)
133133
runs-on: macos-latest
134134
steps:
135135
- uses: actions/checkout@v7
136136
- uses: subosito/flutter-action@v2
137137
with:
138138
channel: stable
139-
flutter-version: 3.38.1
139+
flutter-version: 3.44.0
140140
cache: true
141141
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
142142
- name: Install Tools
@@ -162,14 +162,14 @@ jobs:
162162
- name: Build
163163
run: melos run build:example_linux
164164
build_example_linux_min_flutter:
165-
name: Build Linux example app (3.38.1)
165+
name: Build Linux example app (3.44.0)
166166
runs-on: ubuntu-latest
167167
steps:
168168
- uses: actions/checkout@v7
169169
- uses: subosito/flutter-action@v2
170170
with:
171171
channel: stable
172-
flutter-version: 3.38.1
172+
flutter-version: 3.44.0
173173
cache: true
174174
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
175175
- name: Install Tools
@@ -206,14 +206,14 @@ jobs:
206206
dart pub get
207207
dart run msix:create
208208
build_example_windows_min_flutter:
209-
name: Build Windows example app (3.38.1)
209+
name: Build Windows example app (3.44.0)
210210
runs-on: windows-2022
211211
steps:
212212
- uses: actions/checkout@v7
213213
- uses: subosito/flutter-action@v2
214214
with:
215215
channel: stable
216-
flutter-version: 3.38.1
216+
flutter-version: 3.44.0
217217
cache: true
218218
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
219219
- name: Install Tools
@@ -246,14 +246,14 @@ jobs:
246246
- name: Build
247247
run: melos run build:example_web
248248
build_example_web_min_flutter:
249-
name: Build Web example app (3.38.1)
249+
name: Build Web example app (3.44.0)
250250
runs-on: ubuntu-latest
251251
steps:
252252
- uses: actions/checkout@v7
253253
- uses: subosito/flutter-action@v2
254254
with:
255255
channel: stable
256-
flutter-version: 3.38.1
256+
flutter-version: 3.44.0
257257
cache: true
258258
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
259259
- name: Install Tools
@@ -359,6 +359,7 @@ jobs:
359359
integration_tests_ios:
360360
name: Run integration tests (iOS)
361361
runs-on: macos-latest
362+
timeout-minutes: 60
362363
steps:
363364
- uses: actions/checkout@v7
364365
- uses: subosito/flutter-action@v2
@@ -368,7 +369,7 @@ jobs:
368369
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
369370
- name: Install Tools
370371
run: ./.github/workflows/scripts/install-tools.sh
371-
- uses: futureware-tech/simulator-action@v5
372+
- uses: futureware-tech/simulator-action@v6
372373
id: simulator-action
373374
with:
374375
model: 'iPhone 17'
@@ -379,4 +380,17 @@ jobs:
379380
brew install applesimutils
380381
- name: Grant notification permissions
381382
run: applesimutils --byId ${{ steps.simulator-action.outputs.udid}} --bundle com.dexterous.flutterLocalNotificationsExample --setPermissions notifications=YES
382-
- run: melos run test:integration
383+
# The app sometimes never connects after "Xcode build done" and the
384+
# job would hang until the 6-hour limit. Bound each attempt and retry
385+
# once, only when an attempt timed out.
386+
- name: Run integration tests
387+
run: |
388+
for attempt in 1 2; do
389+
status=0
390+
perl -e 'alarm shift; exec @ARGV' 1200 melos run test:integration || status=$?
391+
if [ "$status" -ne 142 ]; then exit "$status"; fi
392+
echo "::warning::iOS integration tests timed out (attempt $attempt)"
393+
pkill -f flutter_tools.snapshot || true
394+
xcrun simctl terminate ${{ steps.simulator-action.outputs.udid }} com.dexterous.flutterLocalNotificationsExample || true
395+
done
396+
exit 1

‎flutter_local_notifications/CHANGELOG.md‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
## [23.0.4]
2+
3+
* [iOS][macOS] fixed regression issue [#2886](https://github.com/MaikuB/flutter_local_notifications/issues/2886) introduced by 23.0.3 to do with non-Gregorian calendars. Thanks to the PR [weimi89](https://github.com/weimi89)
4+
5+
## [23.0.3]
6+
7+
* [iOS][macOS] fixed notification trigger scheduling to use the Gregorian calendar regardless of the device's current calendar. Thanks to the PR from [Sagar Ghag](https://github.com/GhagSagar23)
8+
9+
## [23.0.2]
10+
11+
* [iOS] fixed issue where provisional notification permission request was not shown when no other permission was requested. Thanks to the PR from [Bilal Aksoy](https://github.com/BiAksoy)
12+
* [Android] fixed issue [#2864](https://github.com/MaikuB/flutter_local_notifications/issues/2864)where the deprecated `AlarmManagerCompat.setExact()` method was being used. Thanks to the PR from [Code Lover](https://github.com/MarkHo-0)
13+
14+
## [23.0.1]
15+
16+
* [Android] fixed issue where cancelling a notification did not work for tag-based notifications when an action with `showsUserInterface` set to `true` was invoked. Thanks to the PR from [Yokota Yuki](https://github.com/y2q-actionman)
17+
* [Windows] improved performance by deferring the native DLL loading until first use. Thanks to the PR from [palmoni5](https://github.com/palmoni5)
18+
19+
## [23.0.0]
20+
21+
* **Breaking change** bumped minimum Flutter SDK requirement to 3.44.0 and Dart SDK requirement to 3.12.0
22+
* [Android] **Breaking change** bumped `compileSdk` to 37 and updated readme to mention this
23+
* [Android] **Breaking change** bumped to AGP 9.1.1
24+
* [Windows] **Breaking change** bumped CMake minimum version to 3.14 and requires the plugin to compile with at least C++ 20 (i.e. `CXX_STANDARD 20`)
25+
* [Android] migrated to Kotlin DSL
26+
* Migrated example app off the Kotlin Gradle Plugin (KGP) in favour of [built-in Kotlin](https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin) and bumped Android Gradle Plugin (AGP) to 9.1.1
27+
* [Android] added support for [live update notifications](https://developer.android.com/develop/ui/compose/notifications/live-update). Example app has been updated to demonstrate usage. Thanks to the PR from [Vasily Laushkin](https://github.com/vlaushkin)
28+
* [Android] plugin now explicitly specifies [background activity launches](https://developer.android.com/guide/components/activities/secure-bal) are [denied](https://developer.android.com/reference/android/app/ActivityOptions#MODE_BACKGROUND_ACTIVITY_START_DENIED) on Android 14+. Notifications are still expected to still work as before and have not found any breaking changes from testing. If any developers happen to find issues related to this change then create a bug report [here](https://github.com/MaikuB/flutter_local_notifications/issues/). Thanks to the PR from [Luca-CZ](https://github.com/Luca-CZ)
29+
* [Android] Fixed a `NullPointerException` crash in `setSmallIcon` (`Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference`) when a scheduled notification is delivered with no `icon`, no persisted default icon, and a null legacy `iconResourceId`. This can happen when a notification serialized by an older version of the plugin fires after an app update. The application's own icon is now used as a fallback so notification delivery no longer crashes. Fixes [#298](https://github.com/MaikuB/flutter_local_notifications/issues/298) and [#2049](https://github.com/MaikuB/flutter_local_notifications/issues/2049). Thanks to the PR from [Michael Allen](https://github.com/mtallenca)
30+
* [Linux] bumped allowed `dbus` dependency version constraints to `>=0.7.8 <0.9.0`
31+
* Updated readme to guidance on handling `PlatformException` being thrown when trying to show notifications when permissions have not been granted due to iOS 27 behavioural changes outside the control of the plugin
32+
* [Windows] fixed issue [#2777](https://github.com/MaikuB/flutter_local_notifications/issues/2777) to ensure future MSVC toolchain compatibility through code changes rather than suppressing a warning. Thanks to [Dragonloverlord](https://github.com/dragonloverlord)
33+
34+
## [22.3.3]
35+
36+
* [Android] fixed issues [#2858](https://github.com/MaikuB/flutter_local_notifications/issues/2858) where for repeating notifications, the specified wall-clock time was not kept when daylight savings related transitions took place. Thanks to the PR from [Metehan Arıman](https://github.com/imariman)
37+
38+
## [22.3.2]
39+
40+
* [iOS] fixed issue [#2838](https://github.com/MaikuB/flutter_local_notifications/issues/2838) so that plugin longer throws `PlatformException`s that started on iOS 27 when permissions were not granted and when badge only notifications were triggered. This restores the behaviour of the plugin to as it was before. Thanks to the PR from [Vasily Laushkin](https://github.com/vlaushkin)
41+
* [Linux] bumped allowed `dbus` dependency version constraints to `>=0.7.8 <0.9.0`
42+
143
## [22.3.1]
244

345
* [macOS] fixed subtitle not showing up properly. Thanks to the PR from [Soi (Jiwon Lee)](https://github.com/JIWON1923)

‎flutter_local_notifications/README.md‎

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ A cross platform plugin for displaying local notifications.
6565
* **Windows** Uses the [C++/WinRT](https://learn.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/) implementation of [Toast Notifications](https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/toast-notifications-overview)
6666
* **Web** Uses the [Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API)
6767

68-
Note: the plugin requires Flutter SDK 3.38.1 at a minimum. The list of support platforms for Flutter 3.38.1 itself can be found [here](https://github.com/flutter/website/blob/6150d58df2f39275ffd589ba32f25557a27e2384/src/content/reference/supported-platforms.md?plain=1#L82)
68+
Note: the plugin requires Flutter SDK 3.44.0 at a minimum. The list of supported platforms for Flutter can be found [here](https://docs.flutter.dev/reference/supported-platforms)
6969

7070
## ✨ Features
7171

@@ -232,9 +232,12 @@ android {
232232
sourceCompatibility JavaVersion.VERSION_17
233233
targetCompatibility JavaVersion.VERSION_17
234234
}
235+
}
235236
236-
kotlinOptions {
237-
jvmTarget = JavaVersion.VERSION_17.toString()
237+
// Only needed if your app has Kotlin sources
238+
kotlin {
239+
compilerOptions {
240+
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
238241
}
239242
}
240243
@@ -260,9 +263,12 @@ android {
260263
sourceCompatibility = JavaVersion.VERSION_17
261264
targetCompatibility = JavaVersion.VERSION_17
262265
}
263-
264-
kotlinOptions {
265-
jvmTarget = JavaVersion.VERSION_17.toString()
266+
}
267+
268+
// Only needed if your app has Kotlin sources
269+
kotlin {
270+
compilerOptions {
271+
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
266272
}
267273
}
268274

@@ -272,14 +278,14 @@ dependencies {
272278
```
273279
</details>
274280

275-
Note that the plugin uses Android Gradle plugin (AGP) 8.11.1 to leverage this functionality so to err on the safe side, applications should aim to use the same version at a **minimum**. If your application uses a higher version then there's no need to use a lower AGP version. For a Flutter app using the legacy `apply` script syntax, this is specified in `android/build.gradle` and the main parts would look similar to the following
281+
Note that the plugin uses Android Gradle plugin (AGP) 9.1.1 to leverage this functionality so to err on the safe side, applications should aim to use the same version at a **minimum**. If your application uses a higher version then there's no need to use a lower AGP version. For a Flutter app using the legacy `apply` script syntax, this is specified in `android/build.gradle` and the main parts would look similar to the following
276282

277283
```gradle
278284
buildscript {
279285
...
280286
281287
dependencies {
282-
classpath 'com.android.tools.build:gradle:8.11.1'
288+
classpath 'com.android.tools.build:gradle:9.1.1'
283289
...
284290
}
285291
```
@@ -293,7 +299,7 @@ If your app is using the new declarative [Plugin DSL syntax](https://docs.flutte
293299
```gradle
294300
plugins {
295301
...
296-
id 'com.android.application' version '8.11.1' apply false
302+
id 'com.android.application' version '9.1.1' apply false
297303
...
298304
}
299305
```
@@ -306,13 +312,15 @@ plugins {
306312
```kotlin
307313
plugins {
308314
...
309-
id("com.android.application") version "8.11.1" apply false
315+
id("com.android.application") version "9.1.1" apply false
310316
...
311317
}
312318
```
313319

314320
</details>
315321

322+
AGP 9 and later use [built-in Kotlin](https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin) instead of applying the Kotlin Gradle Plugin (KGP) directly. If your app still applies the `kotlin-android`/`org.jetbrains.kotlin.android` plugin, follow Flutter's [migration guide for app developers](https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers) to remove it and use the `kotlin { compilerOptions { ... } }` block shown above instead.
323+
316324
There have been reports that enabling desugaring may result in a Flutter apps crashing on Android 12L and above. This would be an issue with Flutter itself, not the plugin. One possible fix is adding the [WindowManager library](https://developer.android.com/jetpack/androidx/releases/window) as a dependency:
317325

318326
<details>
@@ -343,14 +351,14 @@ dependencies {
343351

344352
More information and other proposed solutions can be found in [Flutter issue #110658](https://github.com/flutter/flutter/issues/110658).
345353

346-
The plugin also requires that the `compileSdk` in your application's Gradle file is set to 35 at a minimum:
354+
The plugin also requires that the `compileSdk` in your application's Gradle file is set to 37 at a minimum:
347355

348356
<details>
349357
<summary>Groovy - build.gradle</summary>
350358

351359
```gradle
352360
android {
353-
compileSdk 36
361+
compileSdk 37
354362
...
355363
}
356364
```
@@ -362,7 +370,7 @@ android {
362370

363371
```kotlin
364372
android {
365-
compileSdk = 36
373+
compileSdk = 37
366374
...
367375
}
368376
```
@@ -488,6 +496,10 @@ By design, iOS applications *do not* display notifications while the app is in t
488496

489497
For iOS 10+, use the presentation options to control the behaviour for when a notification is triggered while the app is in the foreground. The default settings of the plugin will configure these such that a notification will be displayed when the app is in the foreground.
490498

499+
### iOS 27 changes
500+
501+
iOS 27 returns errors in cases where earlier versions didn't, such as when permissions haven't been granted or when a notification only updates the badge. The plugin ignores errors in `UNErrorDomain` when showing or scheduling a notification, so these calls behave as they did before. Checking permissions before showing notifications is still recommended so users can be guided on how to grant them. This was reported [here](https://github.com/MaikuB/flutter_local_notifications/issues/2838).
502+
491503
## Web Setup
492504

493505
No modifications to the HTML or JavaScript are necessary. But you must make sure to request permissions at runtime properly!

‎flutter_local_notifications/android/build.gradle‎

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)