I've develop an App which set an image to my contact. It's working fine, my contact has the correct image in the iPhone AddressBook App.
I sync my AddressBook with Google and my contact's image doesn't sync with Google.
Why?? If I set an image using Edit in the AddressBook it's working fine?
What I'm doing wrong??
Cheers and Merry Christmas.
imgEscollida is and UIImage with the right photo contact to set.
ABAddressBookRef addressBook = ABAddressBookCreate();
ABRecordRef record = ABAddressBookGetPersonWithRecordID(addressBook, personaID);
if (record!=nil) {
CFErrorRef *error = nil;
ABPersonSetImageData(record, (CFDataRef)
(UIImagePNGRepresentation([self imgEscollida])), &error);
if (ABAddressBookSave(addressBook, &error)) {
NSLog(@"%s saved successfuly", _cmd);
}
else {
NSLog(@"%s something bad happen while saving", _cmd);
}
}
CFRelease(addressBook);