首页 > 解决方案 > 如何通过 React Native 在 3rd 方应用程序中打开 pdf 文件?

问题描述

我不想使用 RN 库来创建 pdf 查看器,我想单击文件图标并被询问我想在哪个已安装的应用程序中打开文件。

有没有允许我这样做的图书馆?

标签: react-native

解决方案


我在我的项目中使用了rn-fetch-blob 。之后,就很容易了;

安卓

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

iOS

RNFetchBlob.ios.openDocument(path);

推荐阅读