Replyable message notification (w.i.p)

This commit is contained in:
2024-12-21 17:15:14 +08:00
parent dc78f39969
commit eb125fc436
5 changed files with 59 additions and 15 deletions

View File

@ -0,0 +1,20 @@
//
// NotifyDelegate.swift
// Runner
//
// Created by LittleSheep on 2024/12/21.
//
import Foundation
class NotifyDelegate: UIResponder, UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
if let textResponse = response as? UNTextInputNotificationResponse {
let userText = textResponse.userText
print("User replied: \(userText)")
// Handle the reply text
}
completionHandler()
}
}