Contacts for the Apple SDK

Identify contacts, reset contacts, and get named user IDs.

A Contact is any user in your project. Contacts are identified as either an Anonymous Contact or a Named User. Airship can set targeting data on these identifiers, which are also used to map devices and channels to a specific user. For detailed information about contacts and named users, see Named users.

Managing the Contact’s identifier (Named User ID)

Identify can be called multiple times with the same Named User ID. The SDK will automatically deduplicate identify calls made with the same Named User ID. If the ID is changed from a previous value, the Contact will automatically be dissociated from the previous Named User ID.

Identifying the contact

Airship.contact.identify("some named user ID")
[UAirship.contact identify:@"some named user ID"];

If the user logs out of the device, you may want to reset the contact. This will clear any anonymous data and dissociate the contact from the Named User ID, if set. This should only be called when the user manually logs out of the app, otherwise you will not be able to target the Channel by its Contact data.

Resetting the contact

Airship.contact.reset()
[UAirship.contact reset];

You can get the Named User ID only if you set it through the SDK.

Getting the Named User ID

await Airship.contact.namedUserID
[UAirship.contact getNamedUserIDWithCompletionHandler:^(NSString *namedUserID) {

}];