cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Maj (JIRA)" <>
Subject [jira] [Commented] (CB-10496) Missing documentation Contacts-Plugin
Date Thu, 23 Feb 2017 05:39:45 GMT


Filip Maj commented on CB-10496:

I can confirm that on iOS 10.2 on an iPhone 5S, the following code correctly shows the contact
image in the native contacts viewer when a contact is created using the Contacts API:

var contact = navigator.contacts.create({"displayName": "Test User"});
var name = new ContactName();
name.givenName = "Jane";
name.familyName = "Doe"; = name;
var photos = [];
photos[0] = new ContactField('base64', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==',
false); = photos; {
    alert('we saved the freaking contact');
}, function(err) {
    alert('there was an error saving contact!');

On Android, this same code does _not_ add a photo and can confirm this stack trace from logcat:

E/ContactsAccessor( 2821): data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4/8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==:
open failed: ENOENT (No such file or directory)
E/ContactsAccessor( 2821): 	at
E/ContactsAccessor( 2821): 	at<init>(
E/ContactsAccessor( 2821): 	at<init>(
E/ContactsAccessor( 2821): 	at org.apache.cordova.contacts.ContactAccessorSdk5.getPathFromUri(
E/ContactsAccessor( 2821): 	at org.apache.cordova.contacts.ContactAccessorSdk5.getPhotoBytes(
E/ContactsAccessor( 2821): 	at org.apache.cordova.contacts.ContactAccessorSdk5.insertPhoto(
E/ContactsAccessor( 2821): 	at org.apache.cordova.contacts.ContactAccessorSdk5.createNewContact(
E/ContactsAccessor( 2821): 	at
E/ContactsAccessor( 2821): 	at org.apache.cordova.contacts.ContactManager$
E/ContactsAccessor( 2821): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(
E/ContactsAccessor( 2821): 	at java.util.concurrent.ThreadPoolExecutor$
E/ContactsAccessor( 2821): 	at

> Missing documentation Contacts-Plugin
> -------------------------------------
>                 Key: CB-10496
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Contacts
>            Reporter: Arne
>            Priority: Minor
>              Labels: docs, triaged
> Missing documentation on how to set a new contact photo when creating an contact via
> I am trying to create a contact (works fine) but have no idea how to  provide a new picture
(uploaded) to it.
> Tried to set "photos[0].value" to an base64 encoded picture .. but it is not displayed
in contact.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message