joltup / rn-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.81k stars 772 forks source link

Android download file: RNFetchBlob request error: Value for addAndroidDownloads cannot be cast from ReadableNativeMap to Stringnull #676

Open sneznaovca opened 3 years ago

sneznaovca commented 3 years ago

Hi, I am trying run a little modify example to download png file to fs but I get error in handler "RNFetchBlob request error: Value for addAndroidDownloads cannot be cast from ReadableNativeMap to Stringnull". Do you know where could be problem?

  "dependencies": {
    "react": "16.8.3",
    "react-native": "0.59.9",
    "react-viro": "2.17.0",
    "rn-fetch-blob": "^0.10.15"
  },
RNFetchBlob.fetch("GET", "https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png", {
        addAndroidDownloads: {
            useDownloadManager: true,
            description: "An APK that will be installed",
            notification: true,
        }
    })
    .then((res) => {
        console.log("suc");
        console.log(res);
        //console.log(res.path());
    })
    .catch((err) => {
        console.log("error");
        console.log(err.message)
    })