When I try to save an image to the phone (emulator IPhone 11 - iOS 13.1) gallery:
import CameraRoll from "@react-native-community/cameraroll";
...
CameraRoll.saveToCameraRoll('https://example.com/images/1.jpg', 'photo')
.then(() => {
alert('Saved to photos');
})
.catch((err) => {
console.log('err:', err);
});
, it gives me an error:
err: [Error: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.)]
I added these lines to the file "Info.plist":
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires access to the photo library</string>
And run command in "ios" folder:
pod update
pod install
But the error still remains. Is there anything I have to do to clean up the error?