我尝试在我的应用程序中使用react-native-file-viewer forviewàpdf文件。我已经导入了这样的lib:import FileViewer from 'react-native-file-viewer';
我做了à功能:
getPdf(){
const path = '../images/Charte.pdf';
FileViewer.open(path).then((res) => {
console.log(res);
}).catch(error => {
console.log(error);
});
}
但当它给我这个错误时:
你有任何线索吗?
我个人使用react-native-pdf-view用于android和webView for ios,你也可以使用google doc技巧在android webView中阅读pdf但它需要连接(更多信息qazxsw poi)