Titanium 2.X

Titanium.Contacts.Person

> Titanium.Contacts.Person

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 only supported on iOS.

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.

  • 0.8
  • 0.8
  • 0.8
Defined By

Properties

Titanium.Contacts.Person
: Dictionary
Addresses for the person. ...

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, County, 'State', Country and ZIP, 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.

Every new line in the Street value may be created using a backslash followed by a letter n, for example, \n.

Titanium.Contacts.Person
: String
Date of birth of the person. ...

Date of birth of the person. Single value.

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

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: Stringreadonly
Date and time that the person record was created. ...

Date and time that the person record was created. Single value.

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

  • 0.8
  • 0.8
Titanium.Contacts.Person
: Dictionary
Dates associated with the person. ...

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"

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Department of the person. ...

Department of the person. Single value.

  • 0.8
  • 0.8
Titanium.Contacts.Person
: Dictionary
Email addresses for the person. ...

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.

Titanium.Contacts.Person
: String
First name of the person. ...

First name of the person. Single value.

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Phonetic first name of the person. ...

Phonetic first name of the person. Single value.

  • 0.8
  • 0.8
Titanium.Contacts.Person
: Stringreadonly
Localized full name of the person. ...

Localized full name of the person. Single value. Read-only on Android.

Titanium.Contacts.Person
: Number
Record identifier of the person. ...

Record identifier of the person. Single value.

  • 0.8
Titanium.Contacts.Person
: Titanium.Blob
Image for the person. ...

Image for the person. Single value.

Set to null to remove the image.

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: Dictionary
Instant messenger names of the person. ...

Instant messenger names 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, MSN, QQ, Skype, or Yahoo.

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Job title of the person. ...

Job title of the person. Single value.

  • 0.8
  • 0.8
Titanium.Contacts.Person
: Number
Determines the type of information the person record contains; either person or organization. ...

Determines the type of information the person record contains; either person or organization. Read-only on Android.

One of Titanium.Contacts.CONTACTS_KIND_PERSON or Titanium.Contacts.CONTACTS_KIND_ORGANIZATION.

Titanium.Contacts.Person
: String
Last name of the person. ...

Last name of the person. Single value.

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Phonetic last name of the person. ...

Phonetic last name of the person. Single value.

  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Middle name of the person. ...

Middle name of the person. Single value.

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Phonetic middle name of the person. ...

Phonetic middle name of the person. Single value.

  • 0.8
  • 0.8
Titanium.Contacts.Person
: Stringreadonly
Date and time that the person record was last modified. ...

Date and time that the person record was last modified. Single value.

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

  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Nickname of the person. ...

Nickname of the person. Single value.

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Notes for the person. ...

Notes for the person. Single value.

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Organization to which the person belongs. ...

Organization to which the person belongs. Single value.

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: Dictionary
Phone numbers for the person. ...

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.

Titanium.Contacts.Person
: Stringreadonly
Prefix for the person. ...

Prefix for the person. Single value.

  • 0.8
  • 0.8
Titanium.Contacts.Person
: Number
Record identifier of the person. ...

Record identifier of the person. Single value.

  • 0.8
  • 0.8
Titanium.Contacts.Person
: Dictionary
Names of people to which the person is related. ...

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.

  • 0.8
  • 0.8
  • 0.8
Titanium.Contacts.Person
: String
Suffix for the person. ...

Suffix for the person. Single value. Read-only on Android.

Titanium.Contacts.Person
: Dictionary
URLs of webpages associated with the person. ...

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.

  • 0.8
  • 0.8
  • 0.8
Defined By

Methods

( String name, Callback<Object> callback )
Adds the specified callback as an event listener for the named event. ...

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

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to invoke when the event is fired.

Returns

  • void
( String name, Dictionary event )
Fires a synthesized event to any registered listeners. ...

Fires a synthesized event to any registered listeners.

Parameters

  • name : String

    Name of the event.

  • event : Dictionary

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

Returns

  • void
Titanium.Contacts.Person
( ) : Dictionary
Gets the value of the address property. ...

Gets the value of the address property.

Returns

Titanium.Contacts.Person
( ) : String
Gets the value of the birthday property. ...

Gets the value of the birthday property.

  • 0.8
  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the created property. ...

Gets the value of the created property.

  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : Dictionary
Gets the value of the date property. ...

Gets the value of the date property.

  • 0.8
  • 0.8
  • 0.8

Returns

Titanium.Contacts.Person
( ) : String
Gets the value of the department property. ...

Gets the value of the department property.

  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : Dictionary
Gets the value of the email property. ...

Gets the value of the email property.

Returns

Titanium.Contacts.Person
( ) : String
Gets the value of the firstName property. ...

Gets the value of the firstName property.

  • 0.8
  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the firstPhonetic property. ...

Gets the value of the firstPhonetic property.

  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the fullName property. ...

Gets the value of the fullName property.

Returns

  • String
Titanium.Contacts.Person
( ) : Number
Gets the value of the id property. ...

Gets the value of the id property.

  • 0.8

Returns

  • Number
Titanium.Contacts.Person
( ) : Titanium.Blob
Gets the value of the image property. ...

Gets the value of the image property.

  • 0.8
  • 0.8
  • 0.8

Returns

Titanium.Contacts.Person
( ) : Dictionary
Gets the value of the instantMessage property. ...

Gets the value of the instantMessage property.

  • 0.8
  • 0.8
  • 0.8

Returns

Titanium.Contacts.Person
( ) : String
Gets the value of the jobTitle property. ...

Gets the value of the jobTitle property.

  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : Number
Gets the value of the kind property. ...

Gets the value of the kind property.

Returns

  • Number
Titanium.Contacts.Person
( ) : String
Gets the value of the lastName property. ...

Gets the value of the lastName property.

  • 0.8
  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the lastPhonetic property. ...

Gets the value of the lastPhonetic property.

  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the middleName property. ...

Gets the value of the middleName property.

  • 0.8
  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the middlePhonetic property. ...

Gets the value of the middlePhonetic property.

  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the modified property. ...

Gets the value of the modified property.

  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the nickname property. ...

Gets the value of the nickname property.

  • 0.8
  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the note property. ...

Gets the value of the note property.

  • 0.8
  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : String
Gets the value of the organization property. ...

Gets the value of the organization property.

  • 0.8
  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : Dictionary
Gets the value of the phone property. ...

Gets the value of the phone property.

Returns

Titanium.Contacts.Person
( ) : String
Gets the value of the prefix property. ...

Gets the value of the prefix property.

  • 0.8
  • 0.8

Returns

  • String
Titanium.Contacts.Person
( ) : Number
Gets the value of the recordId property. ...

Gets the value of the recordId property.

  • 0.8
  • 0.8

Returns

  • Number
Titanium.Contacts.Person
( ) : Dictionary
Gets the value of the relatedNames property. ...

Gets the value of the relatedNames property.

  • 0.8
  • 0.8
  • 0.8

Returns

Titanium.Contacts.Person
( ) : String
Gets the value of the suffix property. ...

Gets the value of the suffix property.

Returns

  • String
Titanium.Contacts.Person
( ) : Dictionary
Gets the value of the url property. ...

Gets the value of the url property.

  • 0.8
  • 0.8
  • 0.8

Returns

( String name, Callback<Object> callback )
Removes the specified callback as an event listener for the named event. ...

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);

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

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

Returns

  • void
Titanium.Contacts.Person
( Dictionary address )
Sets the value of the address property. ...

Sets the value of the address property.

Parameters

Returns

  • void
Titanium.Contacts.Person
( String birthday )
Sets the value of the birthday property. ...

Sets the value of the birthday property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • birthday : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( Dictionary date )
Sets the value of the date property. ...

Sets the value of the date property.

  • 0.8
  • 0.8
  • 0.8

Parameters

Returns

  • void
Titanium.Contacts.Person
( String department )
Sets the value of the department property. ...

Sets the value of the department property.

  • 0.8
  • 0.8

Parameters

  • department : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( Dictionary email )
Sets the value of the email property. ...

Sets the value of the email property.

Parameters

Returns

  • void
Titanium.Contacts.Person
( String firstName )
Sets the value of the firstName property. ...

Sets the value of the firstName property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • firstName : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String firstPhonetic )
Sets the value of the firstPhonetic property. ...

Sets the value of the firstPhonetic property.

  • 0.8
  • 0.8

Parameters

  • firstPhonetic : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( Number id )
Sets the value of the id property. ...

Sets the value of the id property.

  • 0.8

Parameters

  • id : Number

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( Titanium.Blob image )
Sets the value of the image property. ...

Sets the value of the image property.

  • 0.8
  • 0.8
  • 0.8

Parameters

Returns

  • void
Titanium.Contacts.Person
( Dictionary instantMessage )
Sets the value of the instantMessage property. ...

Sets the value of the instantMessage property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • instantMessage : Dictionary

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String jobTitle )
Sets the value of the jobTitle property. ...

Sets the value of the jobTitle property.

  • 0.8
  • 0.8

Parameters

  • jobTitle : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( Number kind )
Sets the value of the kind property. ...

Sets the value of the kind property.

Parameters

  • kind : Number

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String lastName )
Sets the value of the lastName property. ...

Sets the value of the lastName property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • lastName : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String lastPhonetic )
Sets the value of the lastPhonetic property. ...

Sets the value of the lastPhonetic property.

  • 0.8
  • 0.8

Parameters

  • lastPhonetic : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String middleName )
Sets the value of the middleName property. ...

Sets the value of the middleName property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • middleName : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String middlePhonetic )
Sets the value of the middlePhonetic property. ...

Sets the value of the middlePhonetic property.

  • 0.8
  • 0.8

Parameters

  • middlePhonetic : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String nickname )
Sets the value of the nickname property. ...

Sets the value of the nickname property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • nickname : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String note )
Sets the value of the note property. ...

Sets the value of the note property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • note : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String organization )
Sets the value of the organization property. ...

Sets the value of the organization property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • organization : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( Dictionary phone )
Sets the value of the phone property. ...

Sets the value of the phone property.

Parameters

Returns

  • void
Titanium.Contacts.Person
( Number recordId )
Sets the value of the recordId property. ...

Sets the value of the recordId property.

  • 0.8
  • 0.8

Parameters

  • recordId : Number

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( Dictionary relatedNames )
Sets the value of the relatedNames property. ...

Sets the value of the relatedNames property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • relatedNames : Dictionary

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( String suffix )
Sets the value of the suffix property. ...

Sets the value of the suffix property.

Parameters

  • suffix : String

    New value for the property.

Returns

  • void
Titanium.Contacts.Person
( Dictionary url )
Sets the value of the url property. ...

Sets the value of the url property.

  • 0.8
  • 0.8
  • 0.8

Parameters

Returns

  • void