我正在使用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:"
);
任何人都知道如何使用这个库。谢谢
我正在使用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 选择器将包含可以打开文件的支持的应用程序