From 1c6279281352fe46c56a13b7c9022ede795b6092 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 20 Nov 2024 16:58:39 +0200 Subject: [PATCH] Enable inline replies for push notifications. --- .../Notification/Manager/NotificationManager.swift | 12 ++++++------ .../NotificationManagerTests.swift | 11 ++++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift b/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift index d5fd7f7eb0..11fbda7147 100644 --- a/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift +++ b/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift @@ -29,16 +29,16 @@ final class NotificationManager: NSObject, NotificationManagerProtocol { // MARK: NotificationManagerProtocol weak var delegate: NotificationManagerDelegate? - + func start() { - // Not implemented yet - // let replyAction = UNTextInputNotificationAction(identifier: NotificationConstants.Action.inlineReply, - // title: L10n.actionQuickReply, - // options: []) + let replyAction = UNTextInputNotificationAction(identifier: NotificationConstants.Action.inlineReply, + title: L10n.actionQuickReply, + options: []) let messageCategory = UNNotificationCategory(identifier: NotificationConstants.Category.message, - actions: [], + actions: [replyAction], intentIdentifiers: [], options: []) + let inviteCategory = UNNotificationCategory(identifier: NotificationConstants.Category.invite, actions: [], intentIdentifiers: [], diff --git a/UnitTests/Sources/NotificationManager/NotificationManagerTests.swift b/UnitTests/Sources/NotificationManager/NotificationManagerTests.swift index 2755b65e41..a368e4e35a 100644 --- a/UnitTests/Sources/NotificationManager/NotificationManagerTests.swift +++ b/UnitTests/Sources/NotificationManager/NotificationManagerTests.swift @@ -108,15 +108,16 @@ final class NotificationManagerTests: XCTestCase { XCTAssertEqual(request.content.title, "Title") XCTAssertEqual(request.content.subtitle, "Subtitle") } - + func test_whenStart_notificationCategoriesAreSet() throws { - // let replyAction = UNTextInputNotificationAction(identifier: NotificationConstants.Action.inlineReply, - // title: L10n.actionQuickReply, - // options: []) + let replyAction = UNTextInputNotificationAction(identifier: NotificationConstants.Action.inlineReply, + title: L10n.actionQuickReply, + options: []) let messageCategory = UNNotificationCategory(identifier: NotificationConstants.Category.message, - actions: [], + actions: [replyAction], intentIdentifiers: [], options: []) + let inviteCategory = UNNotificationCategory(identifier: NotificationConstants.Category.invite, actions: [], intentIdentifiers: [],