Contacts Application Control – PICK operation
How to handle contact information (such as phone numbers, email addresses, and Web addresses) in your own application's address book using the device's Contacts application. PICK operation displays the contact list and returns specific details from selected contacts back to your own application.
var mimeType = "vnd.tizen.item.type/vnd.tizen.contact";
var selectionMode = new tizen.ApplicationControlData("http://tizen.org/appcontrol/data/selection_mode", ["single"]);
var itemType = new tizen.ApplicationControlData("http://tizen.org/appcontrol/data/social/item_type", ["person"]);
var resultType = new tizen.ApplicationControlData("http://tizen.org/appcontrol/data/social/result_type", ["phone"]);
var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/social/pick", null, mimeType, null, [selectionMode, itemType, resultType]);
var appControlReplyCallback = {
onsuccess: function(data) {
console.log("success reply");
for(var i=0;i<data.length;i++) {
if(data[i].key === "http://tizen.org/appcontrol/data/social/phone") {
console.log(data[i].value[0]);
}
}
},
onfailure: function() {
console.log("fail reply");
}
};
tizen.application.launchAppControl(appControl, "tizen.contacts",
function() {
console.log("launch appControl succeeded");
}, function(e) {
/* Error handling */
}, appControlReplyCallback);