Closed gbau closed 8 years ago
What version of react native are you using? I know in the past they had not supported upload progress in their XMLHttpRequest
abstraction for android, which prompted me to add this guard when trying to add a progress callback. That guard was also present in their examples of using XMLHttpRequest
.
Thanks for the quick response! I'm using 0.26.3. Tried to skim the release notes for recent react native versions, but are they supporting XHR upload progress on Android now?
It looks like they should per their android example in master.
I can try to take a look later but my project is iOS only so I haven't had to use this on android yet. I would expect this library to work on android though, since it's not view related and uses RN's abstractions like XMLHttpRequest
which should work the same on iOS and android.
In the meantime, this library is pretty small and it should be straightforward to add some logging to see if your function is being set on this._xhr.upload.onprogress
here.
Awesome! Appreciate the feedback and this library you've created!
Ohh another thing I'd try is to run the examples from your current version of RN. Try to run that android example I linked to and see if all is working there. If it is, then you'll know for sure that XMLHttpRequest
is working as expected and we'll have to figure out what is going wrong here.
It doesn't work on android, you should update the README to iOS only since it hasn't been tested and currently doesn't work for Android.
I'll work on my own branch and send a PR
@joelwass can you provide any insight into what is not working? This library makes use of standard RN APIs that are supposed to work across iOS and android. So in theory, it should be working for both.
Is the file upload making it to AWS? Is the response handling broken? Nothing working? What version of RN are you on? Is it just the progress method that isn't working, like what this PR was intended for? If not can you open a separate issue with as much detail as you can provide?
Thanks
There is no response, i'm working on error handling because you don't catch an error on the xml request. The xhr has an error but it's not being caught.... from my debugging it's because android does file URI differently, so a file path in iOS won't work for Android. At least that's my theory, i'm still digging
@joelwass were you able to get this working on Android? If yes, could you please provide your solution?
@joelwass is it working in andorid kindly help I got struck with this very badly
On Android, the progress method never gets called.