php-google-contacts-v3-api
php-google-contacts-v3-api copied to clipboard
Missing Contact Name After Update Contact
i want to update contact data, but when i updated the data, the contact name has been missing. this is my code
` $contact->name = 'Test'; $contact->phoneNumber = '081234567890'; $contact->email = '[email protected]';
$contactAfterUpdate = rapidweb\googlecontacts\factories\ContactFactory::submitUpdates($contact);
var_dump($contactAfterUpdate);`
hah, this is what happened to me just right now, and i was going to write a new issue and found yours, maybe i will rewrite my code and use google api directly now.
Does anyone solved this issue?
You need to manually edit proper methods. Name XML has structure
<gd:name>
<gd:givenName>Elizabeth</gd:givenName>
<gd:familyName>Bennet</gd:familyName>
<gd:fullName>Elizabeth Bennet</gd:fullName>
</gd:name>
So in my case I've added to factories/ContactFactory.php (create):
$n = $doc->createElement('gd:name'); $nn = $doc->createElement('gd:givenName', $name); $n->appendChild($nn); $entry->appendChild($n);