Compare commits
2 commits
main
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ca15696db | ||
|
|
7bbafa788c |
4 changed files with 22 additions and 20 deletions
|
|
@ -112,7 +112,7 @@ class BackgroundPush {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
await _flutterLocalNotificationsPlugin.initialize(
|
await _flutterLocalNotificationsPlugin.initialize(
|
||||||
const InitializationSettings(
|
initializationSettings: const InitializationSettings(
|
||||||
android: AndroidInitializationSettings('notifications_icon'),
|
android: AndroidInitializationSettings('notifications_icon'),
|
||||||
iOS: DarwinInitializationSettings(),
|
iOS: DarwinInitializationSettings(),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -161,17 +161,17 @@ abstract class ClientManager {
|
||||||
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
||||||
|
|
||||||
await flutterLocalNotificationsPlugin.initialize(
|
await flutterLocalNotificationsPlugin.initialize(
|
||||||
const InitializationSettings(
|
initializationSettings: const InitializationSettings(
|
||||||
android: AndroidInitializationSettings('notifications_icon'),
|
android: AndroidInitializationSettings('notifications_icon'),
|
||||||
iOS: DarwinInitializationSettings(),
|
iOS: DarwinInitializationSettings(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
flutterLocalNotificationsPlugin.show(
|
flutterLocalNotificationsPlugin.show(
|
||||||
0,
|
id: 0,
|
||||||
title,
|
title: title,
|
||||||
body,
|
body: body,
|
||||||
const NotificationDetails(
|
notificationDetails: const NotificationDetails(
|
||||||
android: AndroidNotificationDetails(
|
android: AndroidNotificationDetails(
|
||||||
'error_message',
|
'error_message',
|
||||||
'Error Messages',
|
'Error Messages',
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,9 @@ Future<void> notificationTap(
|
||||||
.timeout(const Duration(seconds: 3));
|
.timeout(const Duration(seconds: 3));
|
||||||
final messagingStyleInformation =
|
final messagingStyleInformation =
|
||||||
await AndroidFlutterLocalNotificationsPlugin()
|
await AndroidFlutterLocalNotificationsPlugin()
|
||||||
.getActiveNotificationMessagingStyle(room.id.hashCode);
|
.getActiveNotificationMessagingStyle(
|
||||||
|
notificationId: room.id.hashCode,
|
||||||
|
);
|
||||||
if (messagingStyleInformation == null) return;
|
if (messagingStyleInformation == null) return;
|
||||||
l10n ??= await lookupL10n(PlatformDispatcher.instance.locale);
|
l10n ??= await lookupL10n(PlatformDispatcher.instance.locale);
|
||||||
messagingStyleInformation.messages?.add(
|
messagingStyleInformation.messages?.add(
|
||||||
|
|
@ -214,10 +216,10 @@ Future<void> notificationTap(
|
||||||
);
|
);
|
||||||
|
|
||||||
await FlutterLocalNotificationsPlugin().show(
|
await FlutterLocalNotificationsPlugin().show(
|
||||||
room.id.hashCode,
|
id: room.id.hashCode,
|
||||||
room.getLocalizedDisplayname(MatrixLocals(l10n)),
|
title: room.getLocalizedDisplayname(MatrixLocals(l10n)),
|
||||||
input,
|
body: input,
|
||||||
NotificationDetails(
|
notificationDetails: NotificationDetails(
|
||||||
android: AndroidNotificationDetails(
|
android: AndroidNotificationDetails(
|
||||||
AppConfig.pushNotificationsChannelId,
|
AppConfig.pushNotificationsChannelId,
|
||||||
l10n.incomingMessages,
|
l10n.incomingMessages,
|
||||||
|
|
|
||||||
|
|
@ -42,10 +42,10 @@ Future<void> pushHelper(
|
||||||
|
|
||||||
l10n ??= await lookupL10n(PlatformDispatcher.instance.locale);
|
l10n ??= await lookupL10n(PlatformDispatcher.instance.locale);
|
||||||
flutterLocalNotificationsPlugin.show(
|
flutterLocalNotificationsPlugin.show(
|
||||||
notification.roomId?.hashCode ?? 0,
|
id: notification.roomId?.hashCode ?? 0,
|
||||||
l10n.newMessageInFluffyChat,
|
title: l10n.newMessageInFluffyChat,
|
||||||
l10n.openAppToReadMessages,
|
body: l10n.openAppToReadMessages,
|
||||||
NotificationDetails(
|
notificationDetails: NotificationDetails(
|
||||||
iOS: const DarwinNotificationDetails(),
|
iOS: const DarwinNotificationDetails(),
|
||||||
android: AndroidNotificationDetails(
|
android: AndroidNotificationDetails(
|
||||||
AppConfig.pushNotificationsChannelId,
|
AppConfig.pushNotificationsChannelId,
|
||||||
|
|
@ -220,7 +220,7 @@ Future<void> _tryPushHelper(
|
||||||
|
|
||||||
final messagingStyleInformation = PlatformInfos.isAndroid
|
final messagingStyleInformation = PlatformInfos.isAndroid
|
||||||
? await AndroidFlutterLocalNotificationsPlugin()
|
? await AndroidFlutterLocalNotificationsPlugin()
|
||||||
.getActiveNotificationMessagingStyle(id)
|
.getActiveNotificationMessagingStyle(notificationId: id)
|
||||||
: null;
|
: null;
|
||||||
messagingStyleInformation?.messages?.add(newMessage);
|
messagingStyleInformation?.messages?.add(newMessage);
|
||||||
|
|
||||||
|
|
@ -317,10 +317,10 @@ Future<void> _tryPushHelper(
|
||||||
}
|
}
|
||||||
|
|
||||||
await flutterLocalNotificationsPlugin.show(
|
await flutterLocalNotificationsPlugin.show(
|
||||||
id,
|
id: id,
|
||||||
title,
|
title: title,
|
||||||
body,
|
body: body,
|
||||||
platformChannelSpecifics,
|
notificationDetails: platformChannelSpecifics,
|
||||||
payload: FluffyChatPushPayload(
|
payload: FluffyChatPushPayload(
|
||||||
client.clientName,
|
client.clientName,
|
||||||
event.room.id,
|
event.room.id,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue