Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

Responses come back but callback is never called #26

Closed
PimDeWitte opened this issue Jun 14, 2016 · 5 comments
Closed

Responses come back but callback is never called #26

PimDeWitte opened this issue Jun 14, 2016 · 5 comments

Comments

@PimDeWitte
Copy link

PimDeWitte commented Jun 14, 2016

Hey, I'm seeing a strange issue on Android when I try to use this lib.
screen shot 2016-06-14 at 9 59 44 am

I'm working on an application that needs to download images from the web, and store them on device. However, as you can see, the process is completed by AsyncHTTP, but the callback itself is never called.

My code:

RNFetchBlob
.config({
fileCache: true,
path : fileName
})
.fetch('GET', tile.url, {})
.then((res) => {
console.log("Saved to " + res.path())
processedTiles++;
if (processedTiles >= tilesToBeProcessed) {
parent.onTileProcessed(card, index);
}
});

@wkh237
Copy link
Owner

wkh237 commented Jun 14, 2016

Hi @PimDeWitte , thanks for your informing. I am looking into this issue, but I need some time. Besides, I noticed that your config have both fileCache and path property, if you're going to save the file to an absolute path, the fileCache property won't be necessary. fileCache property means it will use a temp path, by design, it will be ignored when path has value : )

@PimDeWitte
Copy link
Author

I figured it out. The GET parameters are not respected in android

e.g.

http://google.com?q=X will be sent properly on iOS, but will be sent as http://google.com on android @wkh237

@PimDeWitte
Copy link
Author

@wkh237 any direction where I could look? Pretty urgent for me to get this fixed. This is so much better then the react-native-fs lib :-)

@wkh237 wkh237 self-assigned this Jun 15, 2016
wkh237 added a commit that referenced this issue Jun 15, 2016
wkh237 added a commit that referenced this issue Jun 15, 2016
@wkh237 wkh237 added the bug label Jun 15, 2016
@wkh237
Copy link
Owner

wkh237 commented Jun 15, 2016

@PimDeWitte , great thanks for your information! Looks like I added params twice on Android. So the server doesn't response as expect.

I've just solved this issue but it's based on 0.5.2 branch, the IOS HTTP implementation is quite different from previous version, if you're going to fix it base on 0.5.1 please check here for the implementation and here for the test cases.

I will publish 0.5.2 once I finished updating the README.md.

@PimDeWitte
Copy link
Author

@wkt
thanks so much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants