Post

Replies

Boosts

Views

Activity

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];`
2
1
303
Oct ’24