Struggling to save an image to the user’s contacts using the Cordova Contacts plugin on Android. Take a look at my code snippet below:
var contact = navigator.contacts.create();
// data.photo contains a valid base64-encoded string.
contact.photos[0] = {
"type": "base64",
"value": data.photo
};
contact.save(function() {
alert(“Contact saved.”);
}
The above code functions flawlessly on iOS, however, I'm encountering issues saving an image on Android regardless of trying various methods. The data.photo
is confirmed as a valid base64-encoded string that displays as an image when inputted into a URL bar. Any suggestions or guidance?