# Titanium.Contacts.Person
An object that represents a contact record for a person or organization in the system contacts address book.
# Overview
A person object is created using Titanium.Contacts.createPerson.
The following two kinds of properties exist for this object:
- single value - contains either a
string
ornumber
type value, an array ofstring
type values, ornull
if unset. - multi-value - contains a dictionary with typical keys of
home
,work
and/orother
. Each key contains either astring
type value, an array ofstring
type values, or a dictionary containing key/value pairs withstring
type values.
# Adding and Modifying Properties
Support for adding and modifying properties is currently supported on iOS and Android.
# Keys as Address Book UI Labels
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.
These APIs are unavailable on macOS if the app is built on a version of Xcode < 12.
# Properties
# address
Addresses for the person. Multi-value. Read-only on Android.
The format of the dictionary accepted by this property is as follows:
- Keys: any of
home
,work
, and/orother
. - Values: arrays of dictionary types with seven keys,
CountryCode
,Street
,City
, ,State
,Country
andPostalCode
, each with astring
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.
# alternateBirthday
Alternate birthday of the person. Single Dictionary.
The format of the dictionary accepted by this property is as follows:
- Keys:
calendarIdentifier
,era
,year
,month
,day
andisLeapMonth
. - Values: Use
chinese
,hebrew
andislamic-civil
forcalendarIdentifier
. Usenumber
type forera
,year
,month
andday
. These must be consistent with correspondingcalendarIdentifier
. Useboolean
type forisLeapMonth
.
# birthday
Date of birth of the person. Single value.
Date format is "yyyy-MM-ddTHH:mm:ss.SSS+0000"
# created READONLY
Date and time that the person record was created. Single value. Deprecated since iOS 9.
Date format is "yyyy-MM-ddTHH:mm:ss.SSS+0000"
# date
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:
- Keys: any of
anniversary
and/orother
. - Values: array of
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:
- Keys: any of
home
,work
, and/orother
. - Values: array of
string
type.
# fullName READONLY
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.
# identifier READONLY
Identifier of the person.
Prior to iOS 9, use the recordId property.
# image
Image for the person. Single value. Read-only for >= iOS9
Set to null
to remove the image.
# instantMessage
Instant messenger information of the person. Multi-value.
The format of the dictionary accepted by this property is as follows:
- Keys: any of
home
,work
and/orother
. - Values: arrays of dictionary types with two keys,
service
andusername
, each with astring
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.
# kind
Determines the type of information the person record contains; either person or organization. Read-only on Android.
# modified READONLY
Date and time that the person record was last modified. Single value. Deprecated since iOS 9.
Date format is "yyyy-MM-ddTHH:mm:ss.SSS+0000"
# phone
Phone numbers for the person. Multi-value. Read-only on Android.
The format of the dictionary accepted by this property is as follows:
- Keys: any of
home
,work
,other
,mobile
,pager
,workFax
,homeFax
,main
, and/oriPhone
. - Values: array of
string
type.
# recordId
Record identifier of the person. Single value. Deprecated since iOS 9.
For iOS 9 and later, use the identifier property. Previously, a contact can be selected without requiring User permission. In such case this property returns -1.
# relatedNames
Names of people to which the person is related. Multi-value.
The format of the dictionary accepted by this property is as follows:
- Keys: any of
mother
,father
,parent
,brother
,sister
,child
,friend
,spouse
,partner
,assistant
,manager
, and/orother
. - Values: array of
string
type.
# socialProfile
Social profile information of the person. Multi-value.
The format of the dictionary accepted by this property is as follows:
- Keys: any of
home
,work
and/orother
. - Values: arrays of dictionary types with two keys,
service
andusername
each with astring
type value.
The service
key value may be one of twitter
, sinaweibo
, gamecenter
, facebook
,
myspace
, linkedin
, or flickr
. These values are key sensitive.
# url
URLs of webpages associated with the person. Multi-value.
The format of the dictionary accepted by this property is as follows:
- Keys: any of
homepage
,home
,work
, and/orother
. - Values: array of
string
type.