技术解析
Navigator.share https://developer.mozilla.org/zh-CN/docs/Web/API/Navigator/share
if (navigator.canShare && navigator.canShare(大带宽服务器{ files: filesArray })) {
navigator.share({
files: filesArray,
title: 'Pictures',
text: 'Our Pictures.',
})
.then(() => console.log('Share was successful.'))
.catch((error) => console.log('Sharing failed', error));
} else {
console.log(`Your system doesn't support sharing files.`);
}
分享 files 的时候,不支持 iOS 和 Mac?有谁深入使用过这个 API,可以交流一下吗?