Open linhkiubo98 opened 2 years ago
This is my code
let dirs = RNFetchBlob.fs.dirs; const url = item.url; RNFetchBlob.config({ path: dirs.DocumentDir + url.slice(url.lastIndexOf('/'), url.length), addAndroidDownloads: { useDownloadManager: true, title: url.slice(url.lastIndexOf('/') + 1, url.length), mediaScannable: true, notification: true, path: dirs.DocumentDir + url.slice(url.lastIndexOf('/'), url.length), }, fileCache: true, }).fetch('GET', url).then((res) => { console.log(res.data, res.path());
try { RNFetchBlob.ios.openDocument(res.path()) } catch (error) { console.log('xxxxxxxxxxx',error); } });
This module is unmentionable ⚠️! please use fork: https://github.com/RonRadtke/react-native-blob-util
This is my code
let dirs = RNFetchBlob.fs.dirs; const url = item.url; RNFetchBlob.config({ path: dirs.DocumentDir + url.slice(url.lastIndexOf('/'), url.length), addAndroidDownloads: { useDownloadManager: true, title: url.slice(url.lastIndexOf('/') + 1, url.length), mediaScannable: true, notification: true, path: dirs.DocumentDir + url.slice(url.lastIndexOf('/'), url.length), }, fileCache: true, }).fetch('GET', url).then((res) => { console.log(res.data, res.path());