AirshipContactProtocol
public protocol AirshipContactProtocol : AnyObject, Sendable
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.
-
namedUserID
AsynchronousCurrent named user ID
Declaration
Swift
var namedUserID: String? { get async }
-
The named user ID current value publisher.
Declaration
Swift
var namedUserIDPublisher: AnyPublisher<String?, Never> { get }
-
Conflict event publisher.
Declaration
Swift
var conflictEventPublisher: AnyPublisher<ContactConflictEvent, Never> { get }
-
Notifies any edits to the subscription lists.
Declaration
Swift
var subscriptionListEdits: AnyPublisher<ScopedSubscriptionListEdit, Never> { get }
-
fetchSubscriptionLists()
AsynchronousFetches subscription lists.
Declaration
Swift
func fetchSubscriptionLists() async throws -> [String : [ChannelScope]]
Return Value
Subscriptions lists.
-
SMS validator delegate to allow overriding the default SMS validation
Declaration
Swift
var smsValidatorDelegate: (any SMSValidatorDelegate)? { get set }
Return Value
Bool indicating if SMS is valid.
-
validateSMS(_:
Asynchronoussender: ) Validates MSISDN
Declaration
Swift
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.
-
Re-sends the double opt in prompt via the pending or registered channel.
Declaration
Swift
func resend(_ channel: ContactChannel)
Parameters
channel
The pending or registered channel to resend the double opt-in prompt to.
-
Opts out and disassociates channel
Declaration
Swift
func disassociateChannel(_ channel: ContactChannel)
Parameters
channel
The channel to opt-out and disassociate
-
Contact channel updates stream.
Declaration
Swift
var contactChannelUpdates: AsyncStream<ContactChannelsResult> { get }
-
Contact channel updates publisher.
Declaration
Swift
var contactChannelPublisher: AnyPublisher<ContactChannelsResult, Never> { get }
-
Associates the contact with the given named user identifier. The named user ID must be between 1 and 128 characters
Declaration
Swift
func identify(_ namedUserID: String)
Parameters
namedUserID
The named user ID.
-
Disassociate the channel from its current contact, and create a new un-named contact.
Declaration
Swift
func reset()
-
Can be called after the app performs a remote named user association for the channel instead of using
identify
orreset
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
func notifyRemoteLogin()
-
Edits tags.
Declaration
Swift
func editTagGroups() -> TagGroupsEditor
Return Value
A tag groups editor.
-
Edits tags.
Declaration
Swift
func editTagGroups(_ editorBlock: (TagGroupsEditor) -> Void)
Parameters
editorBlock
The editor block with the editor. The editor will
apply
will be called after the block is executed. -
Edits attributes.
Declaration
Swift
func editAttributes() -> AttributesEditor
Return Value
An attributes editor.
-
Edits attributes.
Declaration
Swift
func editAttributes(_ editorBlock: (AttributesEditor) -> Void)
Parameters
editorBlock
The editor block with the editor. The editor will
apply
will be called after the block is executed. -
Associates an Email channel to the contact.
Declaration
Swift
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
func registerSMS(_ msisdn: String, options: SMSRegistrationOptions)
Parameters
msisdn
The SMS msisdn.
options
The SMS channel registration options.
-
Associates an Open channel to the contact.
Declaration
Swift
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
func associateChannel(_ channelID: String, type: ChannelType)
Parameters
channelID
The channel ID.
type
The channel type.
-
Begins a subscription list editing session
Declaration
Swift
func editSubscriptionLists() -> ScopedSubscriptionListEditor
Return Value
A Scoped subscription list editor
-
Begins a subscription list editing session
Declaration
Swift
func editSubscriptionLists( _ editorBlock: (ScopedSubscriptionListEditor) -> Void )
Parameters
editorBlock
A scoped subscription list editor block.