Skip to content

IOS add a photo library selection changed callback #689

@luizppa

Description

@luizppa

Why it is needed?

I have noticed the lack of this feature during a discussion on react-native-image-crop-picker. When the app displays library photos for the user and allows him to change the limited selection, as far as I could tell, there is no way to detect when the selection change has finished in order to update the displayed photos. This leads to a poor user experience and to potential bugs (like trying to access a photo that your app no longer has access to).

Possible implementation

I have no experience with IOS native development, so I can not tell if there is any technical barriers to doing so, but I believe we should have a callback fired when the user finishes editing the allowed photo selection. As I mentioned, I would not know how to do it at first, but I can try making a PR if someone would point me on the right direction.

The result could be something like bellow.

Code sample

import {openLimitedPhotoLibraryPicker} from 'react-native-permissions';

openLimitedPhotoLibraryPicker()
  .catch(() => {
    console.warn('Cannot open photo library picker');
  })
  .then(() => {
    console.log('Limited photo selection changed');
  });

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions