I work on a Messaging app. I am trying to update our app so that it will donate communication intents whenever a message is received. The problem is, even though I am successfully creating an INSendMessageIntent, with a sender (INPerson) with an associated INImage, iOS 15 never actually shows the sender's avatar/image.
Is there something more I need to do? This is basically what my code does:
INImage *senderImage = [INImage imageWithImageData:imageData];
INPerson *const contact = [[INPerson alloc]
initWithPersonHandle:handle
nameComponents:components
displayName:context.notification.content.title
image:senderImage
contactIdentifier:nil
customIdentifier:senderId.stringValue];
INSendMessageIntent *intent = [[INSendMessageIntent alloc]
initWithRecipients:@[recipient]
outgoingMessageType:INOutgoingMessageTypeUnknown
content:messageText
speakableGroupName:nil
conversationIdentifier:threadId
serviceName:@"Instagram Direct"
sender:contact
attachments:nil];
nseContentHandler([notifContent contentByUpdatingWithProvider:intent error:&error]);
I am doing all of this in the Notification Service Extension. I can see that the image is valid/nonnull and the contentByUpdatingWithProvider:error: method does not set an error, so I am quite confused