itinance / itinance/react-native-fs
iOS 13.0+ production Downloadfile function isn't work . but 12.0+ is work,
- Dominant language
- C++
- Stars
- 5k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
1. "react-native": "^0.57.4",
2."react-native-fs": "^2.13.3",
in Development iOS 13.0+ is work . in Production iOS 13.0+ isn't work, but 12.0+ is work.
How to solve? ......
```
let dirs = Platform.OS === 'ios' ? RNFS.LibraryDirectoryPath : RNFS.ExternalDirectoryPath;
const downloadDest = `${dirs}/${timestamp + random}.jpg`;
const formUrl = uri;
const options = {
fromUrl: formUrl,
toFile: downloadDest,
background: true,
begin: (res) => {
},
};
const ret = RNFS.downloadFile(options);
ret.promise.then(res => {
let promise = CameraRoll.saveToCameraRoll(downloadDest);
promise.then(function (result) {
showToast(I18n.t('save_photo_success'));
if (Platform.OS == 'ios') {
try {
RNFS.unlink(downloadDest) //保存成功后删除缓存的照片.
} catch{ }
}
resolve('success');
// content://media/external/images/media/36218
}).catch(function (error) {
resolve('error');
});
}).catch(err => {
});
```

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.