我正在尝试使用以下代码与 Web Share API Level 2 共享文件:
var file = new File(["foo"], "foo.txt", {
type: "text/plain",
});
window.navigator.share({
text: "Share text",
title: "Share title",
files: [file]
})
Run Code Online (Sandbox Code Playgroud)
不幸的是,文件未与 iPhone 共享,但在 Android 上成功共享。
有什么解决办法吗?
提前致谢。