Edit

Share via


ABAddressBook Class

Definition

Provides access to the system Address Book.

[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.None, "Use the 'Contacts' API instead.")]
public class ABAddressBook : IDisposable, ObjCRuntime.INativeObject, System.Collections.Generic.IEnumerable<AddressBook.ABRecord>
type ABAddressBook = class
    interface INativeObject
    interface IDisposable
    interface seq<ABRecord>
    interface IEnumerable
Inheritance
ABAddressBook
Attributes
Implements

Remarks

The Address Book is a centralized database which stores information contacts, such as people and businesses. The notion of "groups" containing one or more contacts is also supported. ABAddressBook supports:

Constructors

ABAddressBook()

Developers should not use this deprecated constructor. Developers should use the static Create method instead

Fields

ErrorDomain

Identifies the error domain under which address book errors are grouped.

Properties

GroupCount

Gets the number of groups in the address book.

Handle

Handle (pointer) to the unmanaged object representation.

HasUnsavedChanges

Indicates whether or not this instance has changes which haven't been saved to the global address book.

PeopleCount

Gets the number of ABPerson records in the address book.

Methods

Add(ABRecord)

Adds a record to the address book.

Create(NSError)
Dispose()

Releases the resources used by the ABAddressBook object.

Dispose(Boolean)

Releases the resources used by the ABAddressBook object.

Finalize()

Finalizer for the ABAddressBook object

GetAllSources()

Returns all of the addresbook sources available on the system.

GetAuthorizationStatus()

What permissions the user has allowed the app.

GetDefaultSource()

Returns the default addressbook source for the system.

GetEnumerator()

Returns an enumerator that iterates through all records and groups in the address book.

GetGroup(Int32)

Returns the ABGroup with the given record ID.

GetGroups()

Gets all groups in the address book.

GetGroups(ABRecord)
GetPeople()

Gets all people in the address book.

GetPeople(ABRecord)
GetPeople(ABRecord, ABPersonSortBy)
GetPeopleWithName(String)

Gets all ABPerson array containing all records with a matching name.

GetPerson(Int32)

Returns the ABPerson with the given record ID.

GetSource(Int32)

Returns a specific addressbook source

LocalizedLabel(NSString)

Localize a record-property label into the current UI language.

OnExternalChange(ExternalChangeEventArgs)

Raises the ExternalChange event.

Remove(ABRecord)

Removes a record from the address book.

RequestAccess(Action<Boolean,NSError>)

Presents the user with a standard permissions dialog, requesting access to the address book.

Revert()

Discards unsaved changes to the address book.

Save()

Saves unsaved changes made to the current instance to the global Address Book database.

Events

ExternalChange

Occurs when the address book is modified.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through all records and groups in the address book.

Applies to