Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Problem: I wish to open pdf saved in internal storage of the phone but its giving me an error as Possible Unhandled Promise Rejection (id:0).

Package used: react-native-openanything

What I have tried:

JavaScript
import React from 'react';
import {
   SafeAreaView,
   View,
   Button,
} from 'react-native';
import * as OpenAnything from 'react-native-openanything';
    
export default function App() {
   return (
      <SafeAreaView>
        <View>
          <Button title='pdf' onPress={() => OpenAnything.Pdf('file:///storage/emulated/0/TestPDF/timetablepdf.pdf')}/>
        </View>
      </SafeAreaView>
    );
  };
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900