-
Notifications
You must be signed in to change notification settings - Fork 1.6k
.progress() not working #37
Comments
Hi @vaibhawc , thank you for your information! Looks like the progress report mechanism is broken since I change the HTTP implementation. I'll fix this issue. |
Thank you @wkh237 , that was very quick and sincere. I am actually trying to send an image where I need to know progress as well handle cancel and resume. I haven't tried it yet, but will have to handle it by my own. It might be a good idea to consider such options like onCancel, onResume. Basically they are inspired by the firebase-storage-api. Or may be I should put it on separate thread. |
Hi @vaibhawc , thank you for your suggestion and feedback, I've published a new version |
Hi @wkh237 ,It works well, thank you. RNFB is an amazing problem solver for me. |
|
Are you sure this works? As in my case it doesn't seem to enter in the functions and jumps directly to .then()/.catch(). It waited for the file to upload but never executed anything inside the .progress().
Or may be you could provide an example(point me to it) on how to use it.
Btw, thanks, I'm new to RN and iOS, when nothing else seemed to work, rnfb worked well.
here:
trySendingImageToServer(url,base64ImageString,tryNum){
RNFetchBlob.fetch('POST',url,{
'Authorization' : 'Basic YWRtaW46MXEydzNlNHIlVA==',
},base64ImageString)
.progress((received,total)=>{
console.log('progress',received/total);
})
.then((resp)=>{
console.log("Response : ",resp.text());
})
.catch((err)=>{
console.log("Error : ",err);
if (tryNum>0){
this.trySendingImageToServer(url,base64ImageString,tryNum-1);
console.log("Trying again.. "+tryNum);
}
else{
console.log("Not trying anymore");
Alert.alert('Please check your connection');
}
});
}
The text was updated successfully, but these errors were encountered: