React-native-fetch-blob: How to use cache?

Created on 7 Mar 2017  路  3Comments  路  Source: wkh237/react-native-fetch-blob

  • 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?

documentation

Most helpful comment

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,
      })

All 3 comments

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 How to retrieve the cached file with the key?

the same problem

Was this page helpful?
0 / 5 - 0 ratings