Skip to content

Commit

Permalink
Merge pull request #2576 from nextcloud/fix/neon_framework/android-pu…
Browse files Browse the repository at this point in the history
…sh-notification-icon
  • Loading branch information
provokateurin authored Oct 21, 2024
2 parents 7c58165 + 296563d commit d0916fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/neon_framework/lib/src/utils/push_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class PushUtils {
final localNotificationsPlugin = FlutterLocalNotificationsPlugin();
await localNotificationsPlugin.initialize(
InitializationSettings(
android: const AndroidInitializationSettings('@mipmap/ic_launcher'),
android: const AndroidInitializationSettings('@drawable/ic_launcher_outline'),
linux: LinuxInitializationSettings(
defaultActionName: localizations.actionOpen,
defaultIcon: AssetsLinuxIcon('assets/logo.svg'),
Expand Down Expand Up @@ -173,7 +173,6 @@ class PushUtils {
appName ?? appID,
subText: accounts.length > 1 && account != null ? account.humanReadableID : null,
groupKey: '${appID}_app',
icon: '@mipmap/ic_launcher',
largeIcon: largeIconBitmap,
when: when?.millisecondsSinceEpoch,
color: NcColors.primary,
Expand Down
12 changes: 8 additions & 4 deletions packages/neon_framework/test/push_utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ void main() {
FlutterLocalNotificationsPlatform.instance = localNotificationsPlatform;
when(
() => localNotificationsPlatform.initialize(
any(),
any(
that: predicate(
(s) => s is AndroidInitializationSettings && s.defaultIcon == '@drawable/ic_launcher_outline',
),
),
onDidReceiveNotificationResponse: any(named: 'onDidReceiveNotificationResponse'),
),
).thenAnswer((invocation) async {
Expand Down Expand Up @@ -286,7 +290,7 @@ void main() {
d.channelName == 'app' &&
d.subText == null &&
d.groupKey == 'app_app' &&
d.icon == '@mipmap/ic_launcher' &&
d.icon == null &&
d.largeIcon == null &&
d.when == null &&
d.color == NcColors.primary &&
Expand Down Expand Up @@ -421,7 +425,7 @@ void main() {
d.channelName == 'Files' &&
d.subText == null &&
d.groupKey == 'files_app' &&
d.icon == '@mipmap/ic_launcher' &&
d.icon == null &&
d.largeIcon != null &&
d.when == notificationDate.millisecondsSinceEpoch &&
d.color == NcColors.primary &&
Expand Down Expand Up @@ -469,7 +473,7 @@ void main() {
d.channelName == 'app' &&
d.subText == null &&
d.groupKey == 'app_app' &&
d.icon == '@mipmap/ic_launcher' &&
d.icon == null &&
d.largeIcon == null &&
d.when == null &&
d.color == NcColors.primary &&
Expand Down

0 comments on commit d0916fa

Please sign in to comment.