Match renamed push payload fields from chat service
Server-side renamed `convoGroupName` -> `groupName` and `convoMemberCount` -> `groupMemberCount` in the additional payload. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -104,7 +104,7 @@ class NotificationService: UNNotificationServiceExtension {
|
|||||||
|
|
||||||
var speakableGroupName: INSpeakableString? = nil
|
var speakableGroupName: INSpeakableString? = nil
|
||||||
if userInfo["convoKind"] as? String == "group",
|
if userInfo["convoKind"] as? String == "group",
|
||||||
let groupName = userInfo["convoGroupName"] as? String,
|
let groupName = userInfo["groupName"] as? String,
|
||||||
!groupName.isEmpty {
|
!groupName.isEmpty {
|
||||||
speakableGroupName = INSpeakableString(spokenPhrase: groupName)
|
speakableGroupName = INSpeakableString(spokenPhrase: groupName)
|
||||||
}
|
}
|
||||||
@@ -126,10 +126,10 @@ class NotificationService: UNNotificationServiceExtension {
|
|||||||
// `recipientCount` on the donation metadata is Apple's documented escape
|
// `recipientCount` on the donation metadata is Apple's documented escape
|
||||||
// hatch for this case, and overrides the (zero-length) recipients array.
|
// hatch for this case, and overrides the (zero-length) recipients array.
|
||||||
if userInfo["convoKind"] as? String == "group",
|
if userInfo["convoKind"] as? String == "group",
|
||||||
let convoMemberCount = userInfo["convoMemberCount"] as? Int,
|
let groupMemberCount = userInfo["groupMemberCount"] as? Int,
|
||||||
convoMemberCount > 0 {
|
groupMemberCount > 0 {
|
||||||
let metadata = INSendMessageIntentDonationMetadata()
|
let metadata = INSendMessageIntentDonationMetadata()
|
||||||
metadata.recipientCount = convoMemberCount
|
metadata.recipientCount = groupMemberCount
|
||||||
intent.donationMetadata = metadata
|
intent.donationMetadata = metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ class NotificationService: UNNotificationServiceExtension {
|
|||||||
userInfo: [AnyHashable: Any]
|
userInfo: [AnyHashable: Any]
|
||||||
) {
|
) {
|
||||||
guard userInfo["convoKind"] as? String == "group",
|
guard userInfo["convoKind"] as? String == "group",
|
||||||
let groupName = userInfo["convoGroupName"] as? String,
|
let groupName = userInfo["groupName"] as? String,
|
||||||
!groupName.isEmpty else {
|
!groupName.isEmpty else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user