简体   繁体   English

React-Native Android,重置默认应用

[英]React-Native android, reset default apps

I my application I use react-native with rn-fetch-blob to fetch images/pdf files. 在我的应用程序中,我使用rn-fetch-blob和react-native来获取图像/ pdf文件。 On the first run, when I try to open, let's say, a pdf file, on android I get a native dialog, something like "Open with ..." and a list of apps that support pdf. 第一次运行时,当我尝试打开pdf文件时,在android上,我得到一个本机对话框,类似“用...打开”,以及支持pdf的应用程序列表。 I get to choose whether to use a certain app "just once" or "always". 我可以选择“仅一次”还是“始终”使用某个应用。

If I select "always", I don't get the dialog anymore, which is expected. 如果选择“始终”,则不会再出现该对话框,这是预期的。 I am just wondering, is it possible to programmatically reset the selected default app, so I can get that dialog again? 我只是想知道,是否可以通过编程方式重置所选的默认应用,所以我可以再次获得该对话框?

我认为通过react-native-share获得期望行为的另一种方式也请检查以下选项:showAppsToView

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM