mangstadt / ez-vcard

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

Relations and Anniversaries are lost in serialization #137

Closed fgubler closed 1 year ago

fgubler commented 1 year ago

Unless I am missing something, the properties relations and anniversaries on the VCard class are completely ignored when the VCF file content is created using Ezvcard.write(vCards).go().

Is this on purpose? Am I using it wrong? I have noticed that also the contact-apps by Google and Samsung seem to lose some data when creating VCF files but I don't see why...

mangstadt commented 1 year ago

Those properties are only supported by vCard version 4.0. By default, ez-vcard writes vCards in accordance with version 3.0, and it will exclude any properties that aren't supported by this version.

To include the ANNIVERSARY and RELATED properties, you'll need to do one of the following:

Ezvcard.write(vCards).version(VCardVersion.V4_0).go();
Ezvcard.write(vCards).versionStrict(false).go();
fgubler commented 1 year ago

Wow thanks a lot for the fast and precise answer :-). And thanks even more for the nice the and comfortable-to-use library: really appreciate it.