react-native-file-viewer在我的应用程序中不起作用

问题描述 投票:1回答:1

我尝试在我的应用程序中使用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);
        });
    }

但当它给我这个错误时:

enter image description here

你有任何线索吗?

javascript reactjs react-native
1个回答
0
投票

我个人使用react-native-pdf-view用于android和webView for ios,你也可以使用google doc技巧在android webView中阅读pdf但它需要连接(更多信息qazxsw poi)

© www.soinside.com 2019 - 2024. All rights reserved.