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

Notification false does not work on Android

Open LorandP opened this issue 7 years ago • 1 comments

const download = (url: string, imageTimeStamp: number, callback: (filepath: string) => void) => {
  let ext: string = '.jpg';
  const { config, fs } = RNFetchBlob;
  let PictureDir = fs.dirs.PictureDir;
  console.log('PictureDir - ', PictureDir);
  try {
    let options = {
      notification: false,
      addAndroidDownloads: {
        useDownloadManager: true,
        path: PictureDir + '/profile_image_' + imageTimeStamp.toString() + ext,
        description: 'Image'
      }
    };

    config(options).fetch('GET', url).then((res) => {
      console.log('res - ', res);
      let filePath = options.addAndroidDownloads.path; 
      callback(filePath);
    });
  } catch (error) {
    console.log('Error in downloading image - ', error);
  }
};

Notification is displayed every time the image has finished downloading. I have also tried to move notification: false in addAndroidDownloads but still does not work. "react-native": "0.53.0" "react-native-fetch-blob": "0.10.8"

LorandP avatar Mar 14 '18 13:03 LorandP

i have same problem, have you find for solution? @LorandP

ardynugraha avatar May 24 '18 10:05 ardynugraha