I have a button with this clickevent:
function onSuccess(contact) {
alert("Save Success");
};
function onError(contactError) {
alert("Error = " + contactError.code);
};
alert("1");
var myContact = navigator.contacts.create({"displayName": "Jane Doe"});
alert("2");
myContact.note = "This contact has a note.";
alert("3");
var name = new ContactName();
name.givenName = "Jane givenname";
name.familyName = "Doe familyname";
myContact.name = name;
alert("4");
contact.save(onSuccess,onError);
alert("5");
I have ALL android permissions checked in the app settings.
The app gives me the alert windows until alert("4"), but doesn't show 5 and doesn't show "save success" or "error". What am I doing wrong?
This is a basic case to add a contact, so I don't know what is wrong.