使用HTTP URL无法响应本机发送意图openFileChooser选项

问题描述

我正在使用 react-native-send-intent 库打开带有认选项的图像,但是它不起作用,这是我的代码

SendIntentAndroid.openFileChooser(
{
subject: "File subject",fileUrl: "https://homepages.cae.wisc.edu/~ece533/images/airplane.png",type: "image/png",},"Open file with:"
);

任何人都知道如何使用该库。 谢谢

解决方法

以上代码中的问题是类型应为"file_mimetype"

SendIntentAndroid.openFileChooser(
  {
    subject: "File subject",//optional,fileUrl: "https://homepages.cae.wisc.edu/~ece533/images/airplane.png",type: "file_mimetype",},"Open file with:"
);

上述代码将打开Android选择器,以便用户可以选择要处理该文件的应用。

一旦Android选择器将包含可以打开文件的受支持应用程序