react-native-fetch-blob icon indicating copy to clipboard operation
react-native-fetch-blob copied to clipboard

How to use cache?

Open nielsswinkels opened this issue 7 years ago • 3 comments

  • please provide the version of installed library and RN project. 0.10.2

I have set fileCache : true, in RNFetchBlob.config. But if I try to fetch when I have no internet connection, it only goes to catch() because of the Unable to resolve host "example.com": No address associated with hostname. So how would I retrieve the path of the cached file in this case? or am I misunderstanding it, and should I save that path somewhere myself, and use it in case I get the error?

nielsswinkels avatar Mar 07 '17 13:03 nielsswinkels

update:

It seems a key is required in the config as well (must be string). Please write this more clearly in the documentation.

.config({
        fileCache : true,
        key: ''+videoFile.id,
      })

nielsswinkels avatar Mar 07 '17 16:03 nielsswinkels

@nielsswinkels How to retrieve the cached file with the key?

ashokkumar88 avatar Jul 31 '18 07:07 ashokkumar88

the same problem

zhangxiann avatar Aug 10 '18 10:08 zhangxiann