⚗️ Add NSE into macos platform

This commit is contained in:
2024-07-22 00:04:12 +08:00
parent 62edab0131
commit f69339292b
8 changed files with 330 additions and 14 deletions

View File

@ -3,11 +3,10 @@
<plist version="1.0">
<dict>
<key>NSUserActivityTypes</key>
<array/>
<key>INSendMessageIntent</key>
<string></string>
<key>INStartCallIntent</key>
<string></string>
<array>
<string>INStartCallIntent</string>
<string>INSendMessageIntent</string>
</array>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>

View File

@ -31,7 +31,6 @@ class NotificationService: UNNotificationServiceExtension {
}
let userId = metadata["user_id"] as! Int
let userName = metadata["user_name"] as? String
let userNick = metadata["user_nick"] as? String
guard let avatarUrl = bestAttemptContent.userInfo["avatar"] as? String else {
throw ParseNotificationPayloadError.noMetadata("The notification has no avatar url.")
@ -43,7 +42,7 @@ class NotificationService: UNNotificationServiceExtension {
)!
let sender = INPerson(personHandle: handle,
nameComponents: nil,
displayName: userNick,
displayName: bestAttemptContent.title,
image: avatar,
contactIdentifier: nil,
customIdentifier: userName)