AirshipContact

@objc(UAContact)
public final class AirshipContact : NSObject, AirshipContactProtocol, @unchecked Sendable
extension AirshipContact: AirshipPushableComponent
extension AirshipContact: AirshipComponent

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.

  • Declaration

    Swift

    public var contactChannelUpdates: AsyncStream<ContactChannelsResult> { get }
  • Declaration

    Swift

    public var contactChannelPublisher: AnyPublisher<ContactChannelsResult, Never> { get }
  • Publishes all edits made to the subscription lists through the SDK

    Declaration

    Swift

    public var smsValidatorDelegate: SMSValidatorDelegate? { get set }
  • Publishes all edits made to the subscription lists through the SDK

    Declaration

    Swift

    public var subscriptionListEdits: AnyPublisher<ScopedSubscriptionListEdit, Never> { get }
  • Declaration

    Swift

    public var conflictEventPublisher: AnyPublisher<ContactConflictEvent, Never> { get }
  • Declaration

    Swift

    public var namedUserIDPublisher: AnyPublisher<String?, Never> { get }
  • _getNamedUserID() Asynchronous

    Declaration

    Swift

    public func _getNamedUserID() async -> String?
  • namedUserID Asynchronous

    Declaration

    Swift

    public var namedUserID: String? { get async }
  • Declaration

    Swift

    public func airshipReady()
  • Identifies the contact.

    Declaration

    Swift

    public func identify(_ namedUserID: String)

    Parameters

    namedUserID

    The named user ID.

  • Resets the contact.

    Declaration

    Swift

    public func reset()
  • Can be called after the app performs a remote named user association for the channel instead of using identify or reset through the SDK. When called, the SDK will refresh the contact data. Applications should only call this method when the user login has changed.

    Declaration

    Swift

    public func notifyRemoteLogin()
  • Begins a tag groups editing session.

    Declaration

    Swift

    public func editTagGroups() -> TagGroupsEditor

    Return Value

    A TagGroupsEditor

  • Begins a tag groups editing session.

    Declaration

    Swift

    public func editTagGroups(_ editorBlock: (TagGroupsEditor) -> Void)

    Parameters

    editorBlock

    A tag groups editor block.

    Return Value

    A TagGroupsEditor

  • Begins an attribute editing session.

    Declaration

    Swift

    public func editAttributes() -> AttributesEditor

    Return Value

    An AttributesEditor

  • Begins an attribute editing session.

    Declaration

    Swift

    public func editAttributes(_ editorBlock: (AttributesEditor) -> Void)

    Parameters

    editorBlock

    An attributes editor block.

    Return Value

    An AttributesEditor

  • Associates an Email channel to the contact.

    Declaration

    Swift

    public func registerEmail(
        _ address: String,
        options: EmailRegistrationOptions
    )

    Parameters

    address

    The email address.

    options

    The email channel registration options.

  • Associates a SMS channel to the contact.

    Declaration

    Swift

    public func registerSMS(_ msisdn: String, options: SMSRegistrationOptions)

    Parameters

    msisdn

    The SMS Mobile Station International Subscriber Directory Number..

    options

    The SMS channel registration options.

  • validateSMS(_:sender:) Asynchronous

    Validates MSISDN

    Declaration

    Swift

    public func validateSMS(
        _ msisdn: String,
        sender: String
    ) async throws -> Bool

    Parameters

    msisdn

    The mobile phone number to validate.

    sender

    The identifier given to the sender of the SMS message.

    Return Value

    Async boolean indicating validity of msisdn

  • Associates an open channel to the contact.

    Declaration

    Swift

    public func registerOpen(
        _ address: String,
        options: OpenRegistrationOptions
    )

    Parameters

    address

    The open channel address.

    options

    The open channel registration options.

  • Associates a channel to the contact.

    Declaration

    Swift

    public func associateChannel(
        _ channelID: String,
        type: ChannelType
    )

    Parameters

    channelID

    The channel ID.

    type

    The channel type.

    options

    The SMS/email channel options

  • Resends an opt-in message

    Declaration

    Swift

    public func resend(_ channel: ContactChannel)

    Parameters

    channelID

    The channel ID.

    type

    The channel type.

    options

    The SMS/email channel options

  • Disassociates a channel

    Declaration

    Swift

    public func disassociateChannel(_ channel: ContactChannel)

    Parameters

    channel

    The channel to disassociate.

  • Begins a subscription list editing session

    Declaration

    Swift

    public func editSubscriptionLists() -> ScopedSubscriptionListEditor

    Return Value

    A Scoped subscription list editor

  • Begins a subscription list editing session

    Declaration

    Swift

    public func editSubscriptionLists(
        _ editorBlock: (ScopedSubscriptionListEditor) -> Void
    )

    Parameters

    editorBlock

    A scoped subscription list editor block.

    Return Value

    A ScopedSubscriptionListEditor

  • Declaration

    Swift

    @objc(fetchSubscriptionListsWithCompletionHandler:)
    public func _fetchSubscriptionLists() async throws -> [String : ChannelScopes]
  • Declaration

    Swift

    public func fetchSubscriptionLists() async throws -> [String : [ChannelScope]]
  • Declaration

    Swift

    @MainActor
    public func receivedRemoteNotification(
        _ notification: [AnyHashable: Any],
        completionHandler: @escaping (UIBackgroundFetchResult) -> Void
    )