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

IOS openDocument do'nt working - crash app #750

Open linhkiubo98 opened 2 years ago

linhkiubo98 commented 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);

    }
  });
retyui commented 2 years ago

This module is unmentionable ⚠️! please use fork: https://github.com/RonRadtke/react-native-blob-util