mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
修复自定义图标推送不显示 subtitle 的问题。
This commit is contained in:
parent
464f3dd454
commit
1e89b6eb24
@ -46,18 +46,28 @@ class IconProcessor: NotificationContentProcessor {
|
||||
suggestionType: .none
|
||||
)
|
||||
|
||||
// 必须两个接受者,才能显示 subtitle, 别问为什么
|
||||
let placeholderPerson = INPerson(
|
||||
personHandle: INPersonHandle(value: "", type: .unknown),
|
||||
nameComponents: personNameComponents,
|
||||
displayName: personNameComponents.nickname,
|
||||
image: avatar,
|
||||
contactIdentifier: nil,
|
||||
customIdentifier: nil
|
||||
)
|
||||
|
||||
let intent = INSendMessageIntent(
|
||||
recipients: [mePerson],
|
||||
recipients: [mePerson, placeholderPerson],
|
||||
outgoingMessageType: .outgoingMessageText,
|
||||
content: bestAttemptContent.body,
|
||||
speakableGroupName: INSpeakableString(spokenPhrase: personNameComponents.nickname ?? ""),
|
||||
speakableGroupName: INSpeakableString(spokenPhrase: bestAttemptContent.subtitle),
|
||||
conversationIdentifier: bestAttemptContent.threadIdentifier,
|
||||
serviceName: nil,
|
||||
sender: senderPerson,
|
||||
attachments: nil
|
||||
)
|
||||
|
||||
intent.setImage(avatar, forParameterNamed: \.sender)
|
||||
intent.setImage(avatar, forParameterNamed: \.speakableGroupName)
|
||||
|
||||
let interaction = INInteraction(intent: intent, response: nil)
|
||||
interaction.direction = .incoming
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user