Using a group icon with iOS 15 communication notifications
Asked Answered
F

1

0

I have followed the instructions in this great Gist to get a INSendMessageIntent working to display the user's profile image on iOS 15. And it works great.

However, I am unable to figure out how to get the image for a group message to be displayed.

I cannot get it to simultaneously show both the group name and an icon for it. If I don't provide the group as an INPerson in recipients then speakableGroupName will not appear in the notification UI. But the INImage on the group's INPerson is never displayed, nor is the sender's image when I do this.

iMessage seems to show the group icon as well as the group name, so it seems possible with this API.

Flapdoodle answered 23/9, 2021 at 1:34 Comment(0)
C
1

I ran into the same issue and https://mcmap.net/q/988787/-ios-15-communication-notification-picture-not-shown gave me the idea to make this work. You need to pass at least 2 recipients (I used the current user and the sender), then do this and it works!

// Swift
sendMessageIntent.setImage(image, forParameterNamed: \.speakableGroupName)

// Objective-C
[sendMessageIntent setImage:image forParameterNamed:"speakableGroupName"];
Carnify answered 13/10, 2021 at 9:25 Comment(4)
I couldn't get this to work...Flapdoodle
@WilGieseler do you have at least 2 recipients? (you could have miPerson and senderPerson, for example)Carnify
Yes, this turned out to be the issue. Thanks!Flapdoodle
Yay! I'm glad it worked :D I updated my original response to reflect that too!Carnify

© 2022 - 2024 — McMap. All rights reserved.