Estoy tratando de agregar un contacto a un teléfono compartiendo una vcard (archivo .vcf) usando la API para compartir en la web, pero no funciona en Android. Funciona solo en mi iPhone. ¿Alguna idea de por qué no funciona en Android?
<html> <title> Web Share API </title> <body> <div> <div> <button onclick="shareVcard" id="shareFilesButton">Share Files</button> </div> </div> </body> <script> document.getElementById('shareFilesButton').addEventListener("click", () => shareVcard()) function shareVcard() { fetch("sample.vcf") .then(function(response) { return response.text() }) .then(function(text) { var file = new File([text], "sample.vcf", {type: 'text/vcard'}); var filesArray = [file]; var shareData = { files: filesArray }; if (navigator.canShare && navigator.canShare(shareData)) { // Adding title afterwards as navigator.canShare just // takes files as input shareData.title = "vcard"; navigator.share(shareData) .then(() => console.log('Share was successful.')) .catch((error) => console.log('Sharing failed', error)); } else { console.log("Your system doesn't support sharing files."); } }); } </script> </html>