Enable inline replies for push notifications.

This commit is contained in:
Stefan Ceriu 2024-11-20 16:58:39 +02:00 committed by Stefan Ceriu
parent b2137ad01d
commit 1c62792813
2 changed files with 12 additions and 11 deletions

View File

@ -29,16 +29,16 @@ final class NotificationManager: NSObject, NotificationManagerProtocol {
// MARK: NotificationManagerProtocol // MARK: NotificationManagerProtocol
weak var delegate: NotificationManagerDelegate? weak var delegate: NotificationManagerDelegate?
func start() { func start() {
// Not implemented yet let replyAction = UNTextInputNotificationAction(identifier: NotificationConstants.Action.inlineReply,
// let replyAction = UNTextInputNotificationAction(identifier: NotificationConstants.Action.inlineReply, title: L10n.actionQuickReply,
// title: L10n.actionQuickReply, options: [])
// options: [])
let messageCategory = UNNotificationCategory(identifier: NotificationConstants.Category.message, let messageCategory = UNNotificationCategory(identifier: NotificationConstants.Category.message,
actions: [], actions: [replyAction],
intentIdentifiers: [], intentIdentifiers: [],
options: []) options: [])
let inviteCategory = UNNotificationCategory(identifier: NotificationConstants.Category.invite, let inviteCategory = UNNotificationCategory(identifier: NotificationConstants.Category.invite,
actions: [], actions: [],
intentIdentifiers: [], intentIdentifiers: [],

View File

@ -108,15 +108,16 @@ final class NotificationManagerTests: XCTestCase {
XCTAssertEqual(request.content.title, "Title") XCTAssertEqual(request.content.title, "Title")
XCTAssertEqual(request.content.subtitle, "Subtitle") XCTAssertEqual(request.content.subtitle, "Subtitle")
} }
func test_whenStart_notificationCategoriesAreSet() throws { func test_whenStart_notificationCategoriesAreSet() throws {
// let replyAction = UNTextInputNotificationAction(identifier: NotificationConstants.Action.inlineReply, let replyAction = UNTextInputNotificationAction(identifier: NotificationConstants.Action.inlineReply,
// title: L10n.actionQuickReply, title: L10n.actionQuickReply,
// options: []) options: [])
let messageCategory = UNNotificationCategory(identifier: NotificationConstants.Category.message, let messageCategory = UNNotificationCategory(identifier: NotificationConstants.Category.message,
actions: [], actions: [replyAction],
intentIdentifiers: [], intentIdentifiers: [],
options: []) options: [])
let inviteCategory = UNNotificationCategory(identifier: NotificationConstants.Category.invite, let inviteCategory = UNNotificationCategory(identifier: NotificationConstants.Category.invite,
actions: [], actions: [],
intentIdentifiers: [], intentIdentifiers: [],