react-native-image-crop-picker
react-native-image-crop-picker copied to clipboard
Edit selected photos with limited photo library in IOS 14
Version
- react-native-image-crop-picker v0.35.2
- react-native v0.63.4
Platform
- iOS14
Actual Behavior
When I first install my app and try to upload an image, I select "Allow access just to the selected pictures" and pick just one photo. Then if i try to upload another photo i'm not asked again about selecting new ones so my only choices are the previous selections (in this case just that 1 photo).
To add more images to my selection I only can navigate to Settings > Privacy > Photos > App to get the option for "Edit Selected Photos".
Expected Behavior
Is there any way I can Edit that selection inside my app or prompt permissions again to have a better UX for my users?
Thank you!
Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate
I experienced the same issue
+1
+1
+1
I am also experiencing the same issue.
I experienced the same issue
Please fix this. This library is otherwise unusable for ios
I have found that we can retriger image selection with following:
import {openLimitedPhotoLibraryPicker} from 'react-native-permissions';
openLimitedPhotoLibraryPicker().catch(() => {
console.warn('Cannot open photo library picker');
});
I have found that we can retriger image selection with following:
import {openLimitedPhotoLibraryPicker} from 'react-native-permissions'; openLimitedPhotoLibraryPicker().catch(() => { console.warn('Cannot open photo library picker'); });
@MCervenka but how can you get the response in a callback?
The permissions needs to open after Picker - so I added timeout:
if (Platform.OS === 'ios' && cameraOncedOpened) {
try {
setTimeout(openLimitedPhotoLibraryPicker, 300);
} catch (e) {
console.log('openLimitedPhotoLibraryPicker', e);
}
}
cameraOncedOpened = true;
const result = await ImagePicker.openPicker(options);
@mohamed2m2018 then the flow is the same as when you first open the picker after opening the phone. After you click done in selection, it would close and behind it is the ImagePicker - which have updated selection.
has anybody found any other workaround for this???
I do think this is a pretty serious issue with this package. An iOS 14 user will only be able to allow more photos the first time the image picker is open. Every time after that they will be stuck with the images they previously allowed. I like the solution from @MCervenka but I feel like it may be confusing for some users. Here's a similar approach I came up with:
if (Platform.OS === 'ios' && hasOpened) {
return Alert.alert(
'Some alert title',
'Some alert description',
[
{
text: 'Cancel'
},
{
text: 'Allow More',
onPress: () => {
MediaLibrary.presentPermissionsPickerAsync()
}
},
{
text: 'Import,
onPress: doImport
}
]
)
} else doImport()
Where doImport()
calls ImageCropPicker.openPicker
and also sets hasOpened
to true.
Has this been fixed yet? I have not found any sort of callback to when the limited selection changes, I also believe this is a serious problem (but maybe it should be fixed in react-native-permissions instead?).
has anybody found any other workaround for this???
In the meantime, we found a workaround for this by navigating the user to another screen to manage the app permissions and having him navigate back when he is done, this way we can use useFocusEffect
to update the shown photos.