fix(ios): reliably load Communication Notification avatars - #66
Conversation
Prefer INImage imageWithImageData from downloaded/local bytes over imageWithURL on file:// cache paths, set the sender intent image for lock-screen circular avatars, and document usage examples. Co-authored-by: Cursor <cursoragent@cursor.com>
b276051 to
cf26d7f
Compare
|
Hi @izetmolla, thanks for taking the time to investigate this and submit the PR. I reviewed the issue and the proposed implementation in depth. The investigation confirmed that there are real problems in the current Communication Notification avatar handling, particularly around local However, I’m not going to merge PR #66 in its current form. Some parts of the proposed solution go beyond the confirmed root cause, and there are a few areas I’m not comfortable shipping as-is, especially the synchronous remote image loading inside the Notification Service Extension, the additional I’m going to take the underlying issue forward and implement a more narrowly scoped fix in the library, with dedicated runtime validation on iOS before releasing it. Your report and patch were still very useful in identifying the problem, so thank you for bringing this to my attention and for contributing to the project. |
Summary
Fixes iOS Communication Notifications where sender/group avatars often fail to appear as the lock-screen circular avatar (especially after NSE disk caching of
file://URLs).Why this belongs in NotifeeCore
INSendMessageIntentavatar handling lives inios/NotifeeCore/NotifeeCoreUtil.m. The bridge cannot fix intent image persistence — this must load image bytes natively.Changes
inImageFromCommunicationAvatarString:— resolve HTTPS /file:/// absolute / bundle paths, load bytes, buildINImageviaimageWithImageData:(fall back to remoteimageWithURL:only for HTTPS).[intent setImage:avatar forParameterNamed:@"sender"]— required for the circular avatar + app-icon badge layout.customIdentifier: sender[@"id"]— stable person identity for the intent.Before / after
INImage imageWithURL:on NSEfile://cache URLs often fails while iOS persists the intent image (URL-encoded name +.png)imageWithImageData:setImage:forParameterNamed:@"sender"applied when avatar resolvesinitWithString:+imageWithURL:onlyExamples
Direct message (HTTPS — preferred for NSE):
Group:
Remote (server SDK):
Test plan
displayNotificationwith HTTPSsender.avatar→ circular avatar + app badge on lock screen / Notification Centerfile://avatar (simulates NSE cache path) → avatar still rendersgroupName+groupAvatar→ group presentation + imagescommunicationInfoin Notify Kit options → avatar still appliedVerified in production via a local patch on
react-native-notify-kit@10.5.0(Expo SDK 57 / RN New Architecture).Made with Cursor