joltup / rn-fetch-blob

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

Can't download from https source on Adnroid #6

Open polkolins opened 6 years ago

polkolins commented 6 years ago

Do I do something wrong? When I use the same code for https://www.rhodeshouse.ox.ac.uk/media/1002/sample-pdf-file.pdf or whatever else pdf on https I have 0,00b/0,00b on my notifications panel and download is stopped and connection is in progress all the time.

var url  = "http://www.africau.edu/images/default/sample.pdf";
    const { config, fs } = RNFetchBlob
    let PictureDir = fs.dirs.PictureDir
    let options = {
      fileCache: true,
      addAndroidDownloads : {
        useDownloadManager : true,
        notification : true,
        path:  PictureDir + "/example.pdf",
      }
    }
    config(options).fetch('GET', url).then((res) => {
      Alert.alert("Done");
    });

"react": "16.2.0", "react-native": "0.54.2", "react-native-fetch-blob": "^0.10.8"

krisidmisso commented 5 years ago

add trusty: true to config:

let options = {
      fileCache: true,
      trusty: true, <--------------------
      addAndroidDownloads : {
        useDownloadManager : true,
        notification : true,
        path:  PictureDir + "/example.pdf",
      }
    }