react-native-file-viewer doesn't work in my app


ED

I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer';

And I have à function:

getPdf(){
        const path = '../images/Charte.pdf';
        FileViewer.open(path).then((res) => {
            console.log(res);
        }).catch(error => {
            console.log(error);
        });
    }

But when giving me this error:

enter image description here

Do you have any clues?

me

I personally use react-native-pdf-view for android and webView for ios, you can also use google doc trick to read pdf in android webView, but need to connect (more info here )

Related


react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

react-native-file-viewer doesn't work in my app

ED I try to use react-native-file-viewer in my app to view à pdf file. I have imported the lib like this:import FileViewer from 'react-native-file-viewer'; And I have à function: getPdf(){ const path = '../images/Charte.pdf'; FileViewer.open(pa

Routing doesn't work on load on my react native app

username I'm working on a React native project with a login system using Firebase. The login system works normally. I also managed to capture the current user id from Firebase. I tried setting "stay logged in" with the asyncStorage system and current user id.

Routing doesn't work on load on my react native app

username I'm working on a React native project with a login system using Firebase. The login system works normally. I also managed to capture the current user id from Firebase. I tried setting "stay logged in" with the asyncStorage system and current user id.

Fontawesome doesn't work in my React app

Dinosaur I installed font-awesome via npm. "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.15", "@fortawesome/free-solid-svg-icons": "^5.7.2", "@fortawesome/react-fontawesome": "^0.1.4", "axios": "^0.18.0",

react-native-image-viewer - Landscape view doesn't work on IOS

Suther On Android, landscape mode works like a charm, but on IO I found the following issues: Mobile device is in landscape mode: I click on an image (Touchable-Opacity set state modalShow Landscape-Mode will switch to Portrait-Mode after which Modal appears I

react-native-image-viewer - Landscape view doesn't work on IOS

Suther On Android, landscape mode works like a charm, but on IO I found the following issues: Mobile device is in landscape mode: I click on an image (Touchable-Opacity set state modalShow Landscape-Mode will switch to Portrait-Mode after which Modal appears I

Why doesn't my ESLint profile work with React Native?

Sonny Using VSCode, I created a React Native app using expo-cli. I want to use ESLint and Prettier to improve code quality. I want ESLint in the "Problems" tab to print out the error, for example if I have this line var asd = 1;in App.js then ESLint will print

this.setState doesn't work in my React native project

User 5553868 In a React Native app I'm developing, this.setState doesn't work and doesn't update the value in the constructor. But this.state({}) is working. but when i use it it is resetting the constructor anyone please point out what is wrong with this code

this.setState doesn't work in my React native project

User 5553868 In a React Native app I'm developing, this.setState doesn't work and doesn't update the value in the constructor. But this.state({}) is working. but when i use it it is resetting the constructor anyone please point out what is wrong with this code

Why doesn't my ESLint profile work with React Native?

Sonny Using VSCode, I created a React Native app using expo-cli. I want to use ESLint and Prettier to improve code quality. I want ESLint in the "Problems" tab to print out errors, for example if I have this line var asd = 1;in App.js , ESLint will print out U

Why doesn't my ESLint profile work with React Native?

Sonny Using VSCode, I created a React Native app using expo-cli. I want to use ESLint and Prettier to improve code quality. I want ESLint in the "Problems" tab to print out the error, for example if I have this line var asd = 1;in App.js then ESLint will print

Why doesn't my ESLint profile work with React Native?

Sonny Using VSCode, I created a React Native app using expo-cli. I want to use ESLint and Prettier to improve code quality. I want ESLint in the "Problems" tab to print out errors, for example if I have this line var asd = 1;in App.js , ESLint will print out U

Why doesn't my ESLint profile work with React Native?

Sonny Using VSCode, I created a React Native app using expo-cli. I want to use ESLint and Prettier to improve code quality. I want ESLint in the "Problems" tab to print out errors, for example if I have this line var asd = 1;in App.js , ESLint will print out U

In react native app, onclick function doesn't work

Sri Raman I am a new local. I wrote the following code to call a function if the user clicks on the text. var login = React.createClass({ openPopup: function(){ console.log("function called"); }, render: function(){ return (

WebStorm-React-Native App Simulator doesn't work

RC_02 I created a brand new React-Native app using WebStorm. When I click Run -> iOS triggers in iOS Simulator, I don't see iOS Simulator load. I don't see any errors either. Here is the screenshot after running the project. Now I can run react-native run-iost

In react native app, onclick function doesn't work

Sri Raman I am a new local. I wrote the following code to call a function if the user clicks on the text. var login = React.createClass({ openPopup: function(){ console.log("function called"); }, render: function(){ return (

In react native app, onclick function doesn't work

Sri Raman I am a new local. I wrote the following code to call a function if the user clicks on the text. var login = React.createClass({ openPopup: function(){ console.log("function called"); }, render: function(){ return (

In react native app, onclick function doesn't work

Sri Raman I am a new local. I wrote the following code to call a function if the user clicks on the text. var login = React.createClass({ openPopup: function(){ console.log("function called"); }, render: function(){ return (

WebStorm-React-Native App Simulator doesn't work

RC_02 I created a brand new React-Native app using WebStorm. When I click Run -> iOS triggers in iOS Simulator, I don't see iOS Simulator load. I don't see any errors either. Here is the screenshot after running the project. Now I can run react-native run-iost

In react native app, onclick function doesn't work

Sri Raman I am a new local. I wrote the following code to call a function if the user clicks on the text. var login = React.createClass({ openPopup: function(){ console.log("function called"); }, render: function(){ return (

In react native app, onclick function doesn't work

Sri Raman I am a new local. I wrote the following code to call a function if the user clicks on the text. var login = React.createClass({ openPopup: function(){ console.log("function called"); }, render: function(){ return (

WebStorm-React-Native App Simulator doesn't work

RC_02 I created a brand new React-Native app using WebStorm. When I click Run -> iOS triggers in iOS Simulator, I don't see iOS Simulator load. I don't see any errors either. Here is the screenshot after running the project. Now I can run react-native run-iost

bootstrap doesn't work in my create-react-app

Thunder 54 I'm trying to render my React components using traditional bootstrap instead of react-bootstrap. I'm not sure what I'm doing wrong. I have installed bootstrap via npm and used the cdn link along with the script. I feel like I've tried everything her

Why doesn't my debounce function work in a React app with hooks?

rookie My goal is to trigger a fetch request to fetch data from the API after some delay. In my particular case, I have an input field where the user can enter the post ID. I don't want to trigger a fetch request on every number entered in the input field. I o

bootstrap doesn't work in my create-react-app

Thunder 54 I'm trying to render my React components using traditional bootstrap instead of react-bootstrap. I'm not sure what I'm doing wrong. I have installed bootstrap via npm and used the cdn link along with the script. I feel like I've tried everything her

Why doesn't my debounce function work in a React app with hooks?

rookie My goal is to trigger a fetch request to fetch data from the API after some delay. In my particular case, I have an input field where the user can enter the post ID. I don't want to trigger a fetch request on every number entered in the input field. I o