Skip to content
Titanium SDK
Version13.0.1

You are reading 13.0.1. See this page in 13.4.1.

Titanium.Contacts.Person

proxyAndroidiPhoneiPadmacOSsince iPhone 0.8, iPad 0.8, Android 0.8, macOS 9.2.0

Extends Titanium.Proxy

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:

  • single value - contains either a string or number type value, an array of string type values, or null if unset.
  • multi-value - contains a dictionary with typical keys of 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.

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 32

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/or other.
  • Values: arrays of dictionary types with seven keys, 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.

alternateBirthday

DictionaryiPhoneiPadmacOSsince iPhone 3.6.0, iPad 3.6.0, macOS 9.2.0

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 and isLeapMonth.
  • Values: Use 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.

apiName

Stringsince Android 3.2.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0read-only

Inherited from Titanium.Proxy

The name of the API that this proxy corresponds to.

birthday

String

Date of birth of the person. Single value.

Date format is "yyyy-MM-ddTHH:mm:ss.SSS+0000"

bubbleParent

Booleansince Android 3.0.0, iPhone 3.0.0, iPad 3.0.0, macOS 9.2.0

Inherited from Titanium.Proxy

Indicates if the proxy will bubble an event to its parent.

Default: true

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/or other.
  • Values: array of string type.

Date format is "yyyy-MM-ddTHH:mm:ss.SSS+0000"

Department of the person. Single value.

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/or other.
  • Values: array of string type.

firstName

String

First name of the person. Single value.

Phonetic first name of the person. Single value.

fullName

Stringread-only

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.

id

NumberAndroidread-only

Record identifier of the person. Single value.

identifier

StringiPhoneiPadmacOSsince iPhone 5.0.0, iPad 5.0.0, macOS 9.2.0read-only

Identifier of the person.

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:

  • Keys: any of home, work and/or other.
  • Values: arrays of dictionary types with two keys, 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.

jobTitle

String

Job title of the person. Single value.

lastName

String

Last name of the person. Single value.

Phonetic last name of the person. Single value.

Middle name of the person. Single value.

Phonetic middle name of the person. Single value.

nickname

String

Nickname of the person. Single value.

note

String

Notes for the person. Single value.

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:

  • Keys: any of home, work, other, mobile, pager, workFax, homeFax, main, and/or iPhone.
  • Values: array of string type.

prefix

Stringread-only

Prefix for the person. Single value.

recordId

NumberiPhoneiPadmacOSsince 9.2.0iOS ≤8.4

Record identifier of the person. Single value. Deprecated since iOS 9.

For iOS 9 and later, use the Titanium.Contacts.Person.identifier property. Previously, a contact can be selected without requiring User permission. In such case this property returns -1.

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/or other.
  • Values: array of string type.

socialProfile

DictionaryiPhoneiPadmacOSsince iPhone 3.6.0, iPad 3.6.0, macOS 9.2.0

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/or other.
  • Values: arrays of dictionary types with two keys, service and username each with a string type value.

The service key value may be one of twitter, sinaweibo, gamecenter, facebook, myspace, linkedin, or flickr. These values are key sensitive.

suffix

Stringread-only

Suffix for the person. Single value.

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/or other.
  • Values: array of string type.

Methods 4

Inherited from Titanium.Proxy

Adds the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to invoke when the event is fired.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

Inherited from Titanium.Proxy

Fires a synthesized event to any registered listeners.

Parameters
ParametersTypeDescription
nameString

Name of the event.

event?Dictionary

A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Inherited from Titanium.Proxy

Removes the specified callback as an event listener for the named event.

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to remove. Must be the same function passed to addEventListener.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.