javascript - WebShare API 不在 iOS 上共享图像:Angular
问题描述
我正在使用 WebShare API 通过 Web 将图像本地共享到不同的应用程序。它在 Android 设备上运行良好,它们正在共享图像和文本。但是,iOS 中 Safari 上的相同 API 无法这样做。它仅共享与图像一起出现的文本,但图像本身丢失。
这是我的角度代码:
share() {
if (this.windowNavigator.share) {
this.windowNavigator
.share({
files: [this.file],
title: "Title of the image",
text: "Text to accompany the image",
})
.then(() => console.log("Share was successful."))
.catch((error) => console.log("Sharing failed", error));
} else {
console.error("Cannot use Web Share API");
}
}
请帮我继续
解决方案
不支持通过 WebShare API 在 iOS 上共享文件。它仅在 Android 上受支持。
推荐阅读
- android - 如何将列表视图放入具有最大高度限制的约束布局中?
- android - 小米红米Note8 Pro及以上蓝牙“附加设置”
- python - 优化python代码蒙特卡罗模拟
- android - 部分订阅正在退款
- java - 如何将我的 java 代码包含到从 aapt2 链接生成的 apk 中?
- c++ - 高于 int 的 C++ 类型提升
- matlab - 如何使用 MATLAB 应用程序编译器将作者姓名添加到创建的 exe 文件中?
- python - Minikube 上的 Flask 应用程序使用入口拒绝连接
- docker - 为什么我在运行 docker-compose 时无法通过其名称访问另一个 docker 容器
- javascript - 使用 html2canvas 截取网页截图在 ipad 中不起作用