mangstadt / ez-vcard

A vCard parser library for Java
Other
400 stars 92 forks source link

Sharing VCF with image to WhatsApp doesn't work #120

Open juaparser opened 2 years ago

juaparser commented 2 years ago

Hi!

Im trying to export an user from my app into an vcf file using this library. Adding it with ".addPhoto()" method works, being the image a byte array with type JPEG.

The thing is, sharing the vcf to Telegram, Gmail, etc the image is correctly loaded from the ByteArray, but I can't make it work with WhatsApp. The VCF file isn't even shared on chat, it just says "The vcard format is wrong" or something like that.

I've tried to load the image as InputStream and even saving it into a temporary file, and then adding it to the VCF, but still I can't make it work with Whatsapp. Using an url (from Firebase) doesn't load the image either, not even in Telegram or Gmail.

Do anyone have any idea why this is happening?

mangstadt commented 2 years ago

Did you try writing your vCard using a different version? (2.1, 3.0, and 4.0) WhatsApp may only support a specific vCard version.

juaparser commented 2 years ago

Did you try writing your vCard using a different version? (2.1, 3.0, and 4.0) WhatsApp may only support a specific vCard version.

Yes, I've tried all the Vcard versions but neither of them work, so I thought it wasn't problem of the vcard version. Having an URL as photo works, and lets me share the vcard with whatsapp, but the picture can't be seen anywhere. Using it as ByteArray is the only thing that works to me, but Whatsapp doesn't seem to allow it :/

mcfriend99 commented 11 months ago

Did you ever make it work??