chore: Remove Notification actions when using UnifiedPush
This commit is contained in:
parent
8d7f376112
commit
31b3758622
2 changed files with 7 additions and 1 deletions
|
|
@ -448,6 +448,7 @@ class BackgroundPush {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onUpMessage(PushMessage pushMessage, String i) async {
|
Future<void> _onUpMessage(PushMessage pushMessage, String i) async {
|
||||||
|
Logs().wtf('Push Notification from UP received', pushMessage);
|
||||||
final message = pushMessage.content;
|
final message = pushMessage.content;
|
||||||
upAction = true;
|
upAction = true;
|
||||||
final data = Map<String, dynamic>.from(
|
final data = Map<String, dynamic>.from(
|
||||||
|
|
@ -461,6 +462,8 @@ class BackgroundPush {
|
||||||
l10n: l10n,
|
l10n: l10n,
|
||||||
activeRoomId: matrix?.activeRoomId,
|
activeRoomId: matrix?.activeRoomId,
|
||||||
flutterLocalNotificationsPlugin: _flutterLocalNotificationsPlugin,
|
flutterLocalNotificationsPlugin: _flutterLocalNotificationsPlugin,
|
||||||
|
useNotificationActions:
|
||||||
|
false, // Buggy with UP: https://codeberg.org/UnifiedPush/flutter-connector/issues/34
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ Future<void> pushHelper(
|
||||||
L10n? l10n,
|
L10n? l10n,
|
||||||
String? activeRoomId,
|
String? activeRoomId,
|
||||||
required FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
|
required FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
|
||||||
|
bool useNotificationActions = true,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
await _tryPushHelper(
|
await _tryPushHelper(
|
||||||
|
|
@ -34,6 +35,7 @@ Future<void> pushHelper(
|
||||||
l10n: l10n,
|
l10n: l10n,
|
||||||
activeRoomId: activeRoomId,
|
activeRoomId: activeRoomId,
|
||||||
flutterLocalNotificationsPlugin: flutterLocalNotificationsPlugin,
|
flutterLocalNotificationsPlugin: flutterLocalNotificationsPlugin,
|
||||||
|
useNotificationActions: useNotificationActions,
|
||||||
);
|
);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
Logs().e('Push Helper has crashed! Writing into temporary file', e, s);
|
Logs().e('Push Helper has crashed! Writing into temporary file', e, s);
|
||||||
|
|
@ -69,6 +71,7 @@ Future<void> _tryPushHelper(
|
||||||
L10n? l10n,
|
L10n? l10n,
|
||||||
String? activeRoomId,
|
String? activeRoomId,
|
||||||
required FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
|
required FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
|
||||||
|
bool useNotificationActions = true,
|
||||||
}) async {
|
}) async {
|
||||||
final isBackgroundMessage = client == null;
|
final isBackgroundMessage = client == null;
|
||||||
Logs().v(
|
Logs().v(
|
||||||
|
|
@ -278,7 +281,7 @@ Future<void> _tryPushHelper(
|
||||||
importance: Importance.high,
|
importance: Importance.high,
|
||||||
priority: Priority.max,
|
priority: Priority.max,
|
||||||
groupKey: event.room.spaceParents.firstOrNull?.roomId ?? 'rooms',
|
groupKey: event.room.spaceParents.firstOrNull?.roomId ?? 'rooms',
|
||||||
actions: event.type == EventTypes.RoomMember
|
actions: event.type == EventTypes.RoomMember || !useNotificationActions
|
||||||
? null
|
? null
|
||||||
: <AndroidNotificationAction>[
|
: <AndroidNotificationAction>[
|
||||||
AndroidNotificationAction(
|
AndroidNotificationAction(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue