I am trying to create a new contact in Google Contacts with my application developed in Google Apps Script, and that this new contact is synchronized with the contacts of my phone automatically.
I have managed to create the new contact interacting with the Frontend through my own form. The problem I have is that after creating the contact, the contact appears in Google Contacts, but it is not added to "My Contacts" (it is not synchronized with the contacts of my phone), I have to manually, through the webapp Google Contacts, I have to find the contact and click "Add to My Contacts" so that this new contact is synchronized with my phone.
async function crearContacto(infoContactoNuevo){
let familyName = "PRESUPUESTO"
await ContactsApp.createContact(infoContactoNuevo.nombre, familyName, infoContactoNuevo.email);
let contacto = ContactsApp.getContactsByName(infoContactoNuevo.nombre);
contacto[0].addPhone(ContactsApp.Field.MOBILE_PHONE, infoContactoNuevo.telefono);
}
It is my first application, I am a newbie in the world of programming. I appreciate your help.