Essential Kit
Loading...
Searching...
No Matches
AddressBook

The AddressBook class provides cross-platform interface to access the contact information. More...

Static Public Member Functions

static AddressBookContactsAccessStatus GetContactsAccessStatus ()
 Returns the current permission status provided to access the contact data.
 
static void ReadContacts (ReadContactsOptions options, EventCallback< AddressBookReadContactsResult > callback)
 Once after getting the user permission, retrieves all the contact information saved in address book database.
 
Advanced Usage
static void Initialize (AddressBookUnitySettings settings)
 [Advanced] Initializes the address book module with the given settings. This call is optional and only need to be called if you have custom settings to initialize this feature.
 

Detailed Description

In iOS/Android platform, users can grant or deny access to contact data on a per-application basis. And the user is prompted only the first time ReadContacts(EventCallback<AddressBookReadContactsResult>) is requested; any subsequent calls use the existing permissions. You can provide custom usage description in Address Book settings of Essential Kit window.

Member Function Documentation

◆ Initialize()

static void Initialize ( AddressBookUnitySettings settings)
static
Parameters
settingsThe settings to be used for initialization.

The settings configure the default image to be used for address book contacts.

References AddressBookUnitySettings.DefaultImage.

◆ GetContactsAccessStatus()

static AddressBookContactsAccessStatus GetContactsAccessStatus ( )
static

To see different authorization status, see AddressBookContactsAccessStatus.

Returns
The current permission status to access the contact data.

◆ ReadContacts()

static void ReadContacts ( ReadContactsOptions options,
EventCallback< AddressBookReadContactsResult > callback )
static
Parameters
optionsThe options to customize the retrieval of contacts. Can be created with ReadContactsOptions.Builder.
callbackThe delegate VoxelBusters.CoreLibrary.EventCallback<TResult> callback that will be executed after the operation has a result or error.
// example usage
void OnReadContactsFinished(AddressBookReadContactsResult result, Error error)
{
// code to handle the retrieved contacts
}
// usage
AddressBook.ReadContacts(new ReadContactsOptions.Builder().WithLimit(10).Build(), OnReadContactsFinished);
The AddressBook class provides cross-platform interface to access the contact information.
Definition AddressBook.cs:26
static void ReadContacts(ReadContactsOptions options, EventCallback< AddressBookReadContactsResult > callback)
Once after getting the user permission, retrieves all the contact information saved in address book d...
Definition AddressBook.cs:109
This class contains the information retrieved when AddressBook.ReadContacts(EventCallback<AddressBook...
Definition AddressBookReadContactsResult.cs:13
Definition ReadContactsOptions.cs:33
Represents a set of options that can be used to read contacts from the user's device.
Definition ReadContactsOptions.cs:8