I am using ngCordova-Contact plugin, which works fine. But I cant find any solution to set a picture for an contact? My source is an base64 encoded picture - extracted from an existing contact.
If someone knows any examples or documentation regarding this topic…
I’ve never worked with contacts, but if you used this to create a contact (see below), can’t you just do contact.photos[0] = yourBase64Image; ?
Sorry not to be able to help more
function onSuccess(contact) {
alert("Save Success");
};
function onError(contactError) {
alert("Error = " + contactError.code);
};
// create a new contact object
var contact = navigator.contacts.create();
contact.displayName = "Plumber";
contact.nickname = "Plumber"; // specify both to support all devices
// populate some fields
var name = new ContactName();
name.givenName = "Jane";
name.familyName = "Doe";
contact.name = name;
// save to device
contact.save(onSuccess,onError);