react-native - 如何通过 React Native 在 3rd 方应用程序中打开 pdf 文件?
问题描述
我不想使用 RN 库来创建 pdf 查看器,我想单击文件图标并被询问我想在哪个已安装的应用程序中打开文件。
有没有允许我这样做的图书馆?
解决方案
我在我的项目中使用了rn-fetch-blob 。之后,就很容易了;
安卓
const android = RNFetchBlob.android;
android.actionViewIntent(path, 'application/pdf');
iOS
RNFetchBlob.ios.openDocument(path);
推荐阅读
- javascript - v-on:keyup & v-model 不更新数据
- javascript - 在移动设备上的页面滚动上删除 bootstrap 4 工具提示,并在点击切换图标时重新启用
- android - Android - Firestore toObject() 无法反序列化具有嵌套字符串数组的对象
- ios - pod update --verbose & pod install --verbose 未完成,挂起
- spring - Spring如何使用对象?
- python - 如何在 detailview 类上创建验证?
- express - 在 angularjs 模板上使用 egs 视图引擎
- php - POST 不提交并使用来自 POST 的临时数据填充输入字段
- python - 在函数结束时将元组打印到 DataFrame 中
- php - 如何使数组中的公共变量工作?