Open gregzo opened 10 months ago
After looking at the Android code, and at the relevant docs (https://developer.android.com/reference/android/provider/ContactsContract.Contacts.Photo#PHOTO), it seems that the current behaviour is to get the thumbnail size asset on Android, and the full size asset on iOS.
Ideally, we would need to parametrise the image
projection to retrieve the asset matching the requested size. In order to preserve the current behaviour, I propose that we:
imageSize?: "display" | "thumbnail"
property to Projection
imageSize
is undefined, default to thumbnail size OR keep current behaviour for compatibility reasons (full size on iOS, thumbnail on Android)Yeah, I have done some work on this. I've got a few changes on device locally. I'll commit them when I've got the time. If I remember correctly, I was struggling with keeping it both consistent and backwards compatible.
Got a work in progress branch here: https://github.com/capacitor-community/contacts/tree/feat%2Fadd-thumbnail-projection
Is your feature request related to a problem? Please describe. As it stands, on iOS the plugin retrieves the full size image, which can slow things down considerably.
Describe the solution you'd like When displaying contact images as thumbnails, it would be much more efficient to retrieve
CNContactThumbnailImageDataKey
instead ofCNContactImageDataKey
.I'm happy to give it a shot on iOS. I'd simply add a new projection for
thumbnailImage
and implement the Swift plugin accordingly. I have no experience with Android dev unfortunately.Describe alternatives you've considered We could: