Reputation: 53
While developing an application for bada2 using PhoneGap i'v got a following problem:
I tried to refer to my phone contacts and see their birthdays. But when I trying to get the values of the field birthday I always get null. Contact picks up exactly because of alert(contacts[i].displayName)
runs smoothly, and I see the name . All contact birthday filled. Field birthday is present in the object contact in cordova.js. So what am I doing wrong?
A simple example alert(contacts[i].birthday
return null):
var options = new ContactFindOptions();
options.multiple = true;
options.filter = "";
var fields = ["*"];
var onError = function (contactError) {
alert('Error!');
}
try {
var onSuccess = function (contacts) {
if(contacts.length != 0){
for(var i=0; i<contacts.length; i++) {
alert(contacts[i].displayName);
alert(contacts[i].birthday);
}
}
}
} catch(e) {alert("Error Occured: "+e.message);}
navigator.contacts.find(fields, onSuccess, onError, options);
Upvotes: 1
Views: 267