Custom notification images are confused with those from other apps.

My app uses custom notifications with custom images. Why do these images get mixed up with those from other apps, causing my notifications to display images from other apps? `INImage *avatarImage = [INImage imageWithImageData:imageData];

    NSPersonNameComponents *nameComponents = [[NSPersonNameComponents alloc] init];
    nameComponents.nickname = content.title;
    
    INPersonHandle *handle = [[INPersonHandle alloc] initWithValue:nil type:INPersonHandleTypeUnknown];
    
    INPerson *messageSender = [[INPerson alloc] initWithPersonHandle:handle
                                                      nameComponents:nameComponents
                                                         displayName:content.title
                                                               image:avatarImage
                                                   contactIdentifier:nil
                                                    customIdentifier:customIdentifier
                                                                isMe:NO
                                                      suggestionType:(INPersonSuggestionTypeNone)];
    
    INSpeakableString *speakableString = [[INSpeakableString alloc] initWithSpokenPhrase:content.subtitle.length ? content.subtitle : @""];
    
    INSendMessageIntent *intent = [[INSendMessageIntent alloc] initWithRecipients:@[messageSender]
                                                              outgoingMessageType:(INOutgoingMessageTypeOutgoingMessageText)
                                                                          content:content.body
                                                               speakableGroupName:speakableString
                                                           conversationIdentifier:identifier
                                                                      serviceName:nil
                                                                           sender:messageSender
                                                                      attachments:nil];
    
    [intent setImage:avatarImage forParameterNamed:@"speakableGroupName"];
    
    INInteraction *interaction = [[INInteraction alloc]initWithIntent:intent response:nil];
    interaction.direction = INInteractionDirectionIncoming;
    [interaction donateInteractionWithCompletion:nil];
    
    UNNotificationContent *_content = [content contentByUpdatingWithProvider:intent error:nil];
    UNNotificationRequest *request  = [UNNotificationRequest requestWithIdentifier:identifier
                                                                           content:_content
                                                                           trigger:trigger];
    [UNUserNotificationCenter.currentNotificationCenter addNotificationRequest:request withCompletionHandler:completionHandler];`

We believe you might possibly be running into an issue we have seen, and we would like you to file a bug report about this.

To file a bug report, you can use the Feedback Assistant.

Don't forget to include as much information as you can about the cases you see this problem with. Make sure you include code snippets, and also a diagnostic log from the time you have seen this happen.

Please go to https://developer.apple.com/bug-reporting/profiles-and-logs/ and follow the instructions for APNS (Apple Push Notification Service) to install a logging profile on your device.

Once installed, reproduce the problem, and once reproduced create a sysdiagnose following the instructions at the above link as soon as possible. Then attach it to your Feedback report as well.

Once you open the bug report, please post the FB number here for my reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?


Argun Tekant /  DTS Engineer / Core Technologies

Similar issues. It seems that it is currently only happening on the iOS18 system. I even give each INPersonHandle a unique value (like [[INPersonHandle alloc] initWithValue:userId type:INPersonHandleTypeUnknown];)to ensure that it could match to only one avatar, but APNS avatars still mess up between my different users, event between different apps. By the way, it occurs irregularly

Custom notification images are confused with those from other apps.
 
 
Q