Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.22.0
flutter-version: 3.32.0
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Install Tools
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Build
run: melos run build:example_android
build_example_android_3_19:
name: Build Android example app (3.22)
name: Build Android example app (3.32)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -78,7 +78,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.22.0
flutter-version: 3.32.0
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Install Tools
Expand All @@ -100,14 +100,14 @@ jobs:
- name: Build
run: melos run build:example_ios
build_example_ios_3_19:
name: Build iOS example app (3.22)
name: Build iOS example app (3.32)
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.22.0
flutter-version: 3.32.0
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Install Tools
Expand All @@ -129,14 +129,14 @@ jobs:
- name: Build
run: melos run build:example_macos
build_example_macos_3_19:
name: Build macOS example app (3.22)
name: Build macOS example app (3.32)
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.22.0
flutter-version: 3.32.0
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Install Tools
Expand All @@ -162,14 +162,14 @@ jobs:
- name: Build
run: melos run build:example_linux
build_example_linux_3_19:
name: Build Linux example app (3.22)
name: Build Linux example app (3.32)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.22.0
flutter-version: 3.32.0
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Install Tools
Expand Down Expand Up @@ -206,14 +206,14 @@ jobs:
dart pub get
dart run msix:create
build_example_windows_3_19:
name: Build Windows example app (3.22)
name: Build Windows example app (3.32)
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.22.0
flutter-version: 3.32.0
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- name: Install Tools
Expand Down Expand Up @@ -328,8 +328,10 @@ jobs:
id: simulator-action
with:
model: 'iPhone 16'
- run: |
- name: Install applesimutils
run: |
brew tap wix/brew
brew install applesimutils
applesimutils --byId ${{ steps.simulator-action.outputs.udid}} --bundle com.dexterous.flutterLocalNotificationsExample --setPermissions notifications=YES
- name: Grant notification permissions
run: applesimutils --byId ${{ steps.simulator-action.outputs.udid}} --bundle com.dexterous.flutterLocalNotificationsExample --setPermissions notifications=YES
- run: melos run test:integration
4 changes: 3 additions & 1 deletion flutter_local_notifications/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [vNext]
## [20.0.0-dev.1]

* **Breaking change** bumped minimum Flutter SDK requirement to 3.32.0 and Dart SDK requirement to 3.8.0
* [Windows] **Breaking change** removed the `details` parameter from the `zonedScheduleRawXml()` method as it was not actually used. Thanks to the PR from [Levi Lesches](https://github.com/Levi-Lesches)
* Updated readme with information for developers that plan to move to use the UIScene lifecycle

## [19.5.0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ void main() {
DarwinInitializationSettings();
final LinuxInitializationSettings initializationSettingsLinux =
LinuxInitializationSettings(
defaultActionName: 'Open notification',
defaultIcon: AssetsLinuxIcon('icons/app_icon.png'),
);
defaultActionName: 'Open notification',
defaultIcon: AssetsLinuxIcon('icons/app_icon.png'),
);
final InitializationSettings initializationSettings = InitializationSettings(
android: initializationSettingsAndroid,
iOS: initializationSettingsIOS,
macOS: initializationSettingsMacOS,
linux: initializationSettingsLinux);
android: initializationSettingsAndroid,
iOS: initializationSettingsIOS,
macOS: initializationSettingsMacOS,
linux: initializationSettingsLinux,
);
late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
group('initialize()', () {
setUpAll(() async {
Expand All @@ -34,31 +35,43 @@ void main() {
});

testWidgets(
'initialize with settings equal to null for the targeting platform '
'should throw an ArgumentError', (WidgetTester tester) async {
const InitializationSettings initializationSettings =
InitializationSettings();
late Matcher errorMessageMatcher;
if (Platform.isAndroid) {
errorMessageMatcher = equals(
'Android settings must be set when targeting Android platform.');
} else if (Platform.isIOS) {
errorMessageMatcher =
equals('iOS settings must be set when targeting iOS platform.');
} else if (Platform.isLinux) {
equals('Linux settings must be set when targeting Linux platform.');
} else if (Platform.isMacOS) {
errorMessageMatcher =
equals('macOS settings must be set when targeting macOS platform.');
} else {
errorMessageMatcher = anything;
}
expect(
() async => await flutterLocalNotificationsPlugin
.initialize(initializationSettings),
throwsA(isArgumentError.having(
(ArgumentError e) => e.message, 'message', errorMessageMatcher)));
});
'initialize with settings equal to null for the targeting platform '
'should throw an ArgumentError',
(WidgetTester tester) async {
const InitializationSettings initializationSettings =
InitializationSettings();
late Matcher errorMessageMatcher;
if (Platform.isAndroid) {
errorMessageMatcher = equals(
'Android settings must be set when targeting Android platform.',
);
} else if (Platform.isIOS) {
errorMessageMatcher = equals(
'iOS settings must be set when targeting iOS platform.',
);
} else if (Platform.isLinux) {
equals('Linux settings must be set when targeting Linux platform.');
} else if (Platform.isMacOS) {
errorMessageMatcher = equals(
'macOS settings must be set when targeting macOS platform.',
);
} else {
errorMessageMatcher = anything;
}
expect(
() async => await flutterLocalNotificationsPlugin.initialize(
initializationSettings,
),
throwsA(
isArgumentError.having(
(ArgumentError e) => e.message,
'message',
errorMessageMatcher,
),
),
);
},
);
});
group('resolvePlatformSpecificImplementation()', () {
setUpAll(() async {
Expand All @@ -67,57 +80,73 @@ void main() {
});

if (Platform.isIOS) {
testWidgets('Can resolve iOS plugin implementation when running on iOS',
(WidgetTester tester) async {
testWidgets('Can resolve iOS plugin implementation when running on iOS', (
WidgetTester tester,
) async {
expect(
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>(),
isA<IOSFlutterLocalNotificationsPlugin>());
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin
>(),
isA<IOSFlutterLocalNotificationsPlugin>(),
);
});
}

if (Platform.isAndroid) {
testWidgets(
'Can resolve Android plugin implementation when running on Android',
(WidgetTester tester) async {
expect(
'Can resolve Android plugin implementation when running on Android',
(WidgetTester tester) async {
expect(
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>(),
isA<AndroidFlutterLocalNotificationsPlugin>());
});
AndroidFlutterLocalNotificationsPlugin
>(),
isA<AndroidFlutterLocalNotificationsPlugin>(),
);
},
);
}

if (Platform.isIOS) {
testWidgets(
'Returns null trying to resolve Android plugin implementation when '
'running on iOS', (WidgetTester tester) async {
expect(
'Returns null trying to resolve Android plugin implementation when '
'running on iOS',
(WidgetTester tester) async {
expect(
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>(),
isNull);
});
AndroidFlutterLocalNotificationsPlugin
>(),
isNull,
);
},
);
}
if (Platform.isAndroid) {
testWidgets(
'Returns null trying to resolve iOS plugin implementation when '
'running on Android', (WidgetTester tester) async {
expect(
'Returns null trying to resolve iOS plugin implementation when '
'running on Android',
(WidgetTester tester) async {
expect(
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>(),
isNull);
});
IOSFlutterLocalNotificationsPlugin
>(),
isNull,
);
},
);
}

testWidgets('Throws argument error requesting base class type',
(WidgetTester tester) async {
testWidgets('Throws argument error requesting base class type', (
WidgetTester tester,
) async {
expect(
() => flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation(),
throwsArgumentError);
() => flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation(),
throwsArgumentError,
);
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
Expand Down Expand Up @@ -54,11 +55,13 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
Loading
Loading