Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open pdf files in 3rd party app via React Native?

Tags:

react-native

I don't want to use RN libraries to create a pdf viewer, I'd like to click on a file icon and be asked in which installed application would I like to open the file.

Is there any library that allows me that?

like image 778
MazMat Avatar asked Oct 20 '25 04:10

MazMat


1 Answers

I have used rn-fetch-blob in my project. After that, it's easy as doing;

Android

const android = RNFetchBlob.android;
android.actionViewIntent(path, 'application/pdf');

iOS

RNFetchBlob.ios.openDocument(path);
like image 53
JanithaR Avatar answered Oct 22 '25 22:10

JanithaR