Add Contact
The webOS Contacts app exposes a cross-application API allowing you to add a contact on the user's behalf.
To do so, you construct a Contact object and then use the Application Manager's open
method to launch the Contacts app, passing it the object you have created. The Contacts app will create a new contact and display a scene allowing the user to make edits or additions as needed.
See Also:
Example
var contact = {
name: {
"familyName": "Doe",
"givenName": "John",
"middleName": "J.",
"honorificPrefix": "Mr."
},
birthday: "1977-01-18",
nickname: "Johnny",
phoneNumbers: [{
value: "4085555678",
type: "type_work",
primary : true
},{
value: "4085558765",
type: "type_fax",
primary : false
}
],
emails: {
value: "john@does.com",
type: "type_work",
primary : true
},
addresses: {
"streetAddress": '123 Main St.',
"locality": 'Centerville',
"region": "CA",
"postalCode": '98765',
"country": "USA"
},
organizations : {
"name" : "John Doe & Sons",
"title" : "CEO",
"primary" : true
}
}
this.controller.serviceRequest("palm://com.palm.applicationManager", {
method: "open",
parameters:
{
id: "com.palm.app.contacts",
params:
{
contact: contact,
launchType: "newContact"
}
}
});