0
votes

Trying to remove an existing contact's birthday using Google APIs Client Library for Java, but birthdays are never deleted from the contact if it previously had a textual value.

List<Birthday> birthdays = new ArrayList<>();

if (textBirthday != null) {
    Birthday birthday = new Birthday();
    birthday.setText(textBirthday); // some textual representation of a birthday    
    birthdays.add(birthday);
}

person.setBirthdays(birthdays);

If afterwards the birthdays are all removed from the person instance, the birthdays wil keep showing up in the Contacts card (eg., in https://contacts.google.com/ web view).

This only happens when a previous date exists with a "text" format; with a date representation using year+month+day the empty birthdays list takes effect, and birthdays are removed.

Edit:

This is visible using People API updateContact test Rest interface:

enter image description here

How should textual birthdays be removed?

1

1 Answers

0
votes

I found this is actually a bug. I took the liberty to report it in the Google Issue Tracker: https://issuetracker.google.com/issues/153947692