An object that represents a contact record for a person or organization in the system contacts address book.
A person object is created using Titanium.Contacts.createPerson.
The following two kinds of properties exist for this object:
string
or number
type value, an array of string
type
values, or null
if unset.home
, work
and/or other
. Each
key contains either a string
type value, an array of string
type values, or a dictionary
containing key/value pairs with string
type values.Support for adding and modifying properties is currently supported on iOS and Android.
Keys act as labels in the address book user interface.
Although there is limited support for custom, arbitrarily-named, keys when used with multi-value properties, there is no support them with single value properties.
On iOS, creating custom keys is not recommended, and will lead to undefined results.
If a label has been created by the user of the device and used with a multi-value property, it will exist as a key with the same name.
See examples in Titanium.Contacts for more information.
Addresses for the person. Multi-value. Read-only on Android.
The format of the dictionary accepted by this property is as follows:
home
, work
, and/or other
.CountryCode
, Street
, City
,
, State
, Country
and PostalCode
, each with a string
type value.On Android:
'CountryCode' and 'County' are currently not supported.
On iOS:
The CountryCode
key value may be one of the recognized two-character ISO 3166-1 country
codes, and determines the format in which the contact is presented by the address book
user interface. See the wikipedia section
ISO 3166-1 alpha-2
for a comprehensive list of codes.
Alternate birthday of the person. Single Dictionary.
Requires: iOS 8.0 and later
The format of the dictionary accepted by this property is as follows:
calendarIdentifier
, era
, year
, month
, day
and isLeapMonth
.chinese
, hebrew
and islamic-civil
for calendarIdentifier
.
Use number
type for era
, year
, month
and day
. These must be consistent with
corresponding calendarIdentifier
.
Use boolean
type for isLeapMonth
.The name of the API that this proxy corresponds to.
The name of the API that this proxy corresponds to.
The value of this property is the fully qualified name of the API. For example, Button
returns Ti.UI.Button
.
Date of birth of the person. Single value.
Date format is "yyyy-_MM_-ddTHH:mm:ss.SSS+0000"
Indicates if the proxy will bubble an event to its parent.
Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.
Default: true
Date and time that the person record was created. Single value. Deprecated since iOS 9.
Requires: iOS 8.0 and earlier
Date format is "yyyy-_MM_-ddTHH:mm:ss.SSS+0000"
Dates associated with the person. Multi-value.
Adding or modifying this property is not currently supported.
The format of the dictionary accepted by this property is as follows:
anniversary
and/or other
.string
type.Date format is "yyyy-_MM_-ddTHH:mm:ss.SSS+0000"
Email addresses for the person. Multi-value. Read-only on Android.
The format of the dictionary accepted by this property is as follows:
home
, work
, and/or other
.string
type.Phonetic first name of the person. Single value.
Localized full name of the person. Single value. Read-only on Android.
The full name will be printed in the order of. Prefix,first name, middle name, family name, suffix.
Record identifier of the person. Single value.
Identifier of the person.
Requires: iOS 9.0 and later
Prior to iOS 9, use the recordId property.
Image for the person. Single value. Read-only for >= iOS9
Set to null
to remove the image.
Instant messenger information of the person. Multi-value.
The format of the dictionary accepted by this property is as follows:
home
, work
and/or other
.service
and username
, each with a
string
type value.The service
key value may be one of AIM
, Facebook
, GaduGadu
, GoogleTalk
, ICQ
,
Jabber
, MSN
, QQ
, Skype
, or Yahoo
. These values are key sensitive.
Determines the type of information the person record contains; either person or organization. Read-only on Android.
This API can be assigned the following constants:
Phonetic last name of the person. Single value.
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.
Phonetic middle name of the person. Single value.
Date and time that the person record was last modified. Single value. Deprecated since iOS 9.
Requires: iOS 8.0 and earlier
Date format is "yyyy-_MM_-ddTHH:mm:ss.SSS+0000"
Organization to which the person belongs. Single value.
Phone numbers for the person. Multi-value. Read-only on Android.
The format of the dictionary accepted by this property is as follows:
home
, work
, other
, mobile
, pager
, workFax
, homeFax
, main
,
and/or iPhone
.string
type.Record identifier of the person. Single value. Deprecated since iOS 9.
Requires: iOS 8.4 and earlier
For iOS 9 and later, use the identifier property. In iOS 8, a contact can be selected without requiring User permission. In such case this property returns -1.
Adds the specified callback as an event listener for the named event.
Name of the event.
Callback function to invoke when the event is fired.
Applies the properties to the proxy.
Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.
A dictionary of properties to apply.
Fires a synthesized event to any registered listeners.
Name of the event.
A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.
Removes the specified callback as an event listener for the named event.
Multiple listeners can be registered for the same event, so the
callback
parameter is used to determine which listener to remove.
When adding a listener, you must save a reference to the callback function in order to remove the listener later:
var listener = function() { Ti.API.info("Event listener called."); }
window.addEventListener('click', listener);
To remove the listener, pass in a reference to the callback function:
window.removeEventListener('click', listener);
Name of the event.
Callback function to remove. Must be the same function passed to addEventListener
.
Sets the value of the address property.
New value for the property.
Sets the value of the alternateBirthday property.
New value for the property.
Sets the value of the birthday property.
New value for the property.
Sets the value of the bubbleParent property.
New value for the property.
Sets the value of the date property.
New value for the property.
Sets the value of the department property.
New value for the property.
Sets the value of the email property.
New value for the property.
Sets the value of the firstName property.
New value for the property.
Sets the value of the firstPhonetic property.
New value for the property.
Sets the value of the image property.
New value for the property.
Sets the value of the instantMessage property.
New value for the property.
Sets the value of the jobTitle property.
New value for the property.
Sets the value of the lastName property.
New value for the property.
Sets the value of the lastPhonetic property.
New value for the property.
Sets the value of the lifecycleContainer property.
New value for the property.
Sets the value of the middleName property.
New value for the property.
Sets the value of the middlePhonetic property.
New value for the property.
Sets the value of the nickname property.
New value for the property.
Sets the value of the organization property.
New value for the property.
Sets the value of the phone property.
New value for the property.
Sets the value of the recordId property.
New value for the property.
Sets the value of the relatedNames property.
New value for the property.
Sets the value of the socialProfile property.
New value for the property.
Sets the value of the url property.
New value for the property.