react-native-tus-client
react-native-tus-client copied to clipboard
App will cashed on start of uploading in IOS
App will cashed during uploading in IOS
@vinzscam are you there?
Hi, could you please attach a snippet of your code? Otherwise it's hard to reproduce the issue.
@vinzscam here's my code.
const upload = new Upload(file.path || file.uri, {
headers: Api.headers(),
endpoint: url,
retryDelays: [0, 1000, 3000, 5000, 10000, 15000, 20000],
resume: true,
metadata: {
filename: file.fileName ? file.fileName : `${type}.${extension}`,
filetype: type /* for video fileType : 'video' othervise 'photo' */,
album: alias,
default: type != 'video' ? (profile_picture_id ? 1 : 0) : 0,
},
onError: error => {
this.setState({
modalVisible: false,
});
if (error?.originalRequest?._response) {
Toast.show(JSON.parse(error.originalRequest._response).message, {
duration: Toast.durations.LONG,
position: Toast.positions.CENTER,
});
}
},
onProgress: (uploadedBytes, totalBytes) =>
this.uploadingProgress(uploadedBytes, totalBytes),
onSuccess: () => this.onUploadingComplete(type),
});
upload.start();