🐛 Trying to fix the NSE again...

This commit is contained in:
2025-10-28 00:24:55 +08:00
parent 1719b1c8fe
commit 3330ca14dd

View File

@@ -87,13 +87,8 @@ class NotificationService: UNNotificationServiceExtension {
let intent = self.createMessageIntent(with: sender, meta: metaCopy, body: content.body) let intent = self.createMessageIntent(with: sender, meta: metaCopy, body: content.body)
self.donateInteraction(for: intent) self.donateInteraction(for: intent)
let updatedContent = try? request.content.updating(from: intent)
content.categoryIdentifier = "CHAT_MESSAGE" content.categoryIdentifier = "CHAT_MESSAGE"
if let updatedContent = updatedContent { self.contentHandler?(content)
self.contentHandler?(updatedContent)
} else {
self.contentHandler?(content)
}
}) })
} }
@@ -192,7 +187,7 @@ class NotificationService: UNNotificationServiceExtension {
private func createMessageIntent(with sender: INPerson, meta: [AnyHashable: Any], body: String) -> INSendMessageIntent { private func createMessageIntent(with sender: INPerson, meta: [AnyHashable: Any], body: String) -> INSendMessageIntent {
INSendMessageIntent( INSendMessageIntent(
recipients: nil, recipients: nil,
outgoingMessageType: .outgoingMessageText, outgoingMessageType: .incomingMessageText,
content: body, content: body,
speakableGroupName: meta["room_name"] != nil ? INSpeakableString(spokenPhrase: meta["room_name"] as! String) : nil, speakableGroupName: meta["room_name"] != nil ? INSpeakableString(spokenPhrase: meta["room_name"] as! String) : nil,
conversationIdentifier: "\(meta["room_id"] ?? "")", conversationIdentifier: "\(meta["room_id"] ?? "")",