public class

Contact

extends AirshipComponent
java.lang.Object
   ↳ com.urbanairship.AirshipComponent
     ↳ com.urbanairship.contacts.Contact

Class Overview

Airship contact. A contact is distinct from a channel and represents a "user" within Airship. Contacts may be named and have channels associated with it.

Summary

[Expand]
Inherited Fields
From class com.urbanairship.AirshipComponent
Public Constructors
Contact(Context context, PreferenceDataStore preferenceDataStore, AirshipRuntimeConfig runtimeConfig, PrivacyManager privacyManager, AirshipChannel airshipChannel)
Creates a Contact.
Public Methods
void associateChannel(String channelId, ChannelType channelType)
Associates a channel to the contact.
AttributeEditor editAttributes()
Edit the attributes associated with this Contact.
ScopedSubscriptionListEditor editSubscriptionLists()
Edits the subscription lists associated with this Contact.
TagGroupsEditor editTagGroups()
Edit the tags associated with this Contact.
Executor getJobExecutor(JobInfo jobInfo)
Gets the executor for the given job.
String getNamedUserId()
Gets the named user ID.
PendingResult<Map<StringSet<Scope>>> getSubscriptionLists()
Returns the current set of subscription lists for the current contact.
PendingResult<Map<StringSet<Scope>>> getSubscriptionLists(boolean includePendingUpdates)
Returns the current set of subscription lists for the current contact, optionally applying pending subscription list changes that will be applied during the next contact update.
void identify(String externalId)
Associates the contact with the given named user identifier.
void registerEmail(String address, EmailRegistrationOptions options)
Registers an Email channel.
void registerOpenChannel(String address, OpenChannelRegistrationOptions options)
Registers an Open channel.
void registerSms(String msisdn, SmsRegistrationOptions options)
Registers a Sms channel.
void reset()
Disassociate the channel from its current contact, and create a new un-named contact.
void setContactConflictListener(ContactConflictListener listener)
Protected Methods
void init()
Initialize the manager.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Contact (Context context, PreferenceDataStore preferenceDataStore, AirshipRuntimeConfig runtimeConfig, PrivacyManager privacyManager, AirshipChannel airshipChannel)

Creates a Contact.

Parameters
context The application context.
preferenceDataStore The preferences data store.

Public Methods

public void associateChannel (String channelId, ChannelType channelType)

Associates a channel to the contact.

Parameters
channelId The channel Id.
channelType The channel type.

public AttributeEditor editAttributes ()

Edit the attributes associated with this Contact.

Returns

public ScopedSubscriptionListEditor editSubscriptionLists ()

Edits the subscription lists associated with this Contact.

public TagGroupsEditor editTagGroups ()

Edit the tags associated with this Contact.

Returns

public Executor getJobExecutor (JobInfo jobInfo)

Gets the executor for the given job.

Parameters
jobInfo The jobInfo.
Returns
  • An executor that will be used to call #onPerformJob(UAirship, JobInfo).

public String getNamedUserId ()

Gets the named user ID.

Returns
  • The named user ID, or null if it is unknown.

public PendingResult<Map<StringSet<Scope>>> getSubscriptionLists ()

Returns the current set of subscription lists for the current contact.

An empty set indicates that this contact is not subscribed to any lists.

Returns

public PendingResult<Map<StringSet<Scope>>> getSubscriptionLists (boolean includePendingUpdates)

Returns the current set of subscription lists for the current contact, optionally applying pending subscription list changes that will be applied during the next contact update.

An empty set indicates that this contact is not subscribed to any lists.

Parameters
includePendingUpdates `true` to apply pending updates to the returned set, `false` to return the set without pending updates.
Returns

public void identify (String externalId)

Associates the contact with the given named user identifier.

Parameters
externalId The channel's identifier.

public void registerEmail (String address, EmailRegistrationOptions options)

Registers an Email channel.

Parameters
address The Email address to register.
options An EmailRegistrationOptions object that defines registration options.

public void registerOpenChannel (String address, OpenChannelRegistrationOptions options)

Registers an Open channel.

Parameters
address The address to register.
options An SmsRegistrationObject object that defines registration options.

public void registerSms (String msisdn, SmsRegistrationOptions options)

Registers a Sms channel.

Parameters
msisdn The Mobile Station number to register.
options An SmsRegistrationObject object that defines registration options.

public void reset ()

Disassociate the channel from its current contact, and create a new un-named contact.

public void setContactConflictListener (ContactConflictListener listener)

Protected Methods

protected void init ()

Initialize the manager. Called in UAirship during takeoff.