小编zed*_*Art的帖子

React Native:点击按钮下载带有 rn-fetch-blob 的 pdf 文件

我必须让用户在他按下按钮时下载 pdf 文件,我发现我必须使用 rn-fetch-blob 而不是 react-native-fetch-blob。在文档中有这个代码:

const { config, fs } = RNFetchBlob
let DownloadDir = fs.dirs.DownloadDir // this is the Downloads directory.
let options = {
fileCache: true,
addAndroidDownloads : {
useDownloadManager : true, //uses the device's native download manager.
notification : true,
title : "Notification Title", // Title of download notification.
path: DownloadDir + "/me_"+ '.' + extension, // this is the path where your download file will be in
description : 'Downloading file.'
}
}
config(options)
.fetch('GET',"https://whatever_url_u …
Run Code Online (Sandbox Code Playgroud)

react-native-android react-native-fetch-blob

1
推荐指数
2
解决办法
1万
查看次数