One Logo Pool Ball
ProximityReader · IOS API REFERENCE

CustomerEngagementSession

class · iOS 27.0+ · SDK 27.1

final class CustomerEngagementSession

Members (14)

method · iOS 27.0+

requestCustomerInfo

TypeScript
requestCustomerInfo(purpose: (CustomerEngagementSession_Purpose) | null, fields: Array<CustomerEngagementSession_Field>, message?: (string) | null): Promise<CustomerEngagement_CustomerInfo>
Swift declaration
final func requestCustomerInfo(for purpose: CustomerEngagementSession.Purpose? = nil, fields: [CustomerEngagementSession.Field], message: String? = nil) async throws -> CustomerEngagement.CustomerInfo

Opens a form so that the customer can share the contact information. ## Discussion If the `fields` array contains `pass` and a matching `passTypeIdentifier` , it displays the Wallet pass in full screen for the customer to confirm. - Parameters: - purpose: An optional enum of pre-defined purpose of the form, for example `.checkIn`. The `purpose`` parameter supports `.checkIn` and `.receipt`. - fields: An array of contact field types on the form. - message: A multi-line message text below the title. - Returns: ``CustomerEngagement/CustomerInfo`` contact information shared by the customer. - Throws: ``CustomerEngagementSession/Error`` if the request fails. Note: The merchant is responsible for obtaining appropriate consent and maintaining compliant privacy notices for personal information collected through this session.

method · iOS 27.0+

updateStatus

TypeScript
updateStatus(status: CustomerEngagement_Status): Promise<void>
Swift declaration
final func updateStatus(_ status: CustomerEngagement.Status) async throws

Updates the status on the customer's screen. When there isn't any form, like a sign-up form being displayed, the screen defaults to ``CustomerEngagement/Status/ready`` unless there is a ``CustomerEngagement/ShoppingCart``. ``CustomerEngagement/Status/ready`` resets the default screen from ``CustomerEngagement/ShoppingCart``. - Parameters: - status: An enum that defines a fixed status text which includes a title and a subtitle. - Throws: ``CustomerEngagementSession/Error`` if the request fails.

init · iOS 27.0+

init

TypeScript
static init(configuration: CustomerEngagementSession_Configuration): CustomerEngagementSession
Swift declaration
init(configuration: CustomerEngagementSession.Configuration)

Creates a customer engagement session with the specified configuration.

get · iOS 27.0+

configuration

TypeScript
get configuration(): CustomerEngagementSession_Configuration
Swift declaration
final let configuration: CustomerEngagementSession.Configuration

Configuration for this session.

method · iOS 27.0+

requestSignup

TypeScript
requestSignup(purpose: CustomerEngagementSession_Purpose, fields: Array<CustomerEngagementSession_Field>, message?: (string) | null, emailConsent?: CustomerEngagementSession_ConsentOption, smsConsent?: CustomerEngagementSession_ConsentOption, termsAndConditions?: (string) | null): Promise<CustomerEngagement_SignUp>
Swift declaration
final func requestSignup(for purpose: CustomerEngagementSession.Purpose = .membership, fields: [CustomerEngagementSession.Field], message: String? = nil, emailConsent: CustomerEngagementSession.ConsentOption = .hidden, smsConsent: CustomerEngagementSession.ConsentOption = .hidden, termsAndConditions: String? = nil) async throws -> CustomerEngagement.SignUp

Opens a form so that the customer can share the contact information for the purpose of sign-up activity. - Parameters: - purpose: An enum of pre-defined purpose of the form for `.membership`, `.accountCreation`, and `.accountUpdate`. The default is `.membership`. - fields: An array of contact field types on the form. Only `.emailAddress` and `.phoneNumber` types are supported. - message: A multi-line message text below the title. - emailConsent: A consent option to allow or decline promotions and offers over email channel. - smsConsent: A consent option to allow or decline promotions and offers over SMS channel. - termsAndConditions: An optional markdown string to display during the sign-up flow. - Returns: ``CustomerEngagement/SignUp`` contact information shared by the customer. - Throws: ``CustomerEngagementSession/Error`` if the request fails.

method · iOS 27.0+

requestAddress

TypeScript
requestAddress(purpose: (CustomerEngagementSession_Purpose) | null, fields: Array<CustomerEngagementSession_Field>, message?: (string) | null): Promise<CustomerEngagement_Address>
Swift declaration
final func requestAddress(for purpose: CustomerEngagementSession.Purpose? = nil, fields: [CustomerEngagementSession.Field], message: String? = nil) async throws -> CustomerEngagement.Address

Opens a form so that the customer can share the postal address and additionally collect email address and phone number. For example, email and phone number can be used for delivery notification. - Parameters: - purpose: An optional enum of pre-defined purpose of the form, for example `.shipping`. - fields: An array of optional contact field types on the form. Only `.emailAddress` and `.phoneNumber` types are supported. - message: A multi-line message text below the title. - Returns: ``CustomerEngagement/Address`` with postal address and contact information shared by the customer. - Throws: ``CustomerEngagementSession/Error`` if the request fails.

method · iOS 27.0+

requestPayment

TypeScript
requestPayment(shoppingCartToken: CustomerEngagement_ShoppingCartToken, paymentRequest: _PassKit_PKPaymentRequest, delegate: Implements<_PassKit_PKPaymentAuthorizationControllerDelegate> | SDKHandle): Promise<boolean>
Swift declaration
final func requestPayment(for shoppingCartToken: CustomerEngagement.ShoppingCartToken, using paymentRequest: PKPaymentRequest, delegate: any PKPaymentAuthorizationControllerDelegate) async throws -> Bool

Opens a form so a customer can select a payment option.

method · iOS 27.0+

updateShoppingCart

TypeScript
updateShoppingCart(shoppingCart: CustomerEngagement_ShoppingCart): Promise<CustomerEngagement_ShoppingCartToken>
Swift declaration
final func updateShoppingCart(_ shoppingCart: CustomerEngagement.ShoppingCart) async throws -> CustomerEngagement.ShoppingCartToken

Updates the shopping cart on the customer's device. This function can be called repeatedly as the shopping cart is populated, and each update replaces the entire shopping cart. When there isn't any form, like a sign-up form being displayed, the screen defaults to the current ``CustomerEngagement/ShoppingCart``. - Parameters: - shoppingCart: A structure of the shopping cart, consisting of shopping cart items and the summary. - Returns: ``CustomerEngagement/ShoppingCartToken`` for making payment request using ``requestPayment(for:using:delegate:)``. - Throws: ``CustomerEngagementSession/Error`` if the request fails.

get · iOS 27.0+

customerConfiguration

TypeScript
get customerConfiguration(): (CustomerEngagementSession_CustomerConfiguration) | null
Swift declaration
final var customerConfiguration: CustomerEngagementSession.CustomerConfiguration? { get }

A structure containing configuration information of the customer device. The value is available after the ``Event/ready`` event.

method · iOS 27.0+

open

TypeScript
open(token?: (CustomerEngagement_Token) | null): Promise<void>
Swift declaration
final func open(using token: CustomerEngagement.Token? = nil) async throws

Opens the engagement session. - Parameters: - token: `The Customer Engagement token used to authenticate your credentials. If you omit the token, you must have already created a valid ``PaymentCardReaderSession`` before calling this method. - Throws: ``CustomerEngagementSession/Error`` if the open request fails. This method can also throw ``Foundation/URLError``.

method · iOS 27.0+

close

TypeScript
close(): Promise<void>
Swift declaration
final func close() async throws

Closes the engagement session. When this device disconnects, any paired device that is still connected receives a notification to close its side of the session.

get · iOS 27.0+

token

TypeScript
get token(): CustomerEngagementSession_Token
Swift declaration
final let token: CustomerEngagementSession.Token

The session token. This token can be associated with the customer profile and used to check if the new session is a reconnection of the previous session.

get · iOS 27.0+

events

TypeScript
get events(): SDKHandle
Swift declaration
final let events: any AsyncSequence<CustomerEngagementSession.Event, Never>

An asynchronous sequence of events that occur during the engagement session.

method · iOS 27.0+

addPass

TypeScript
addPass(pass: ArrayBuffer): Promise<boolean>
Swift declaration
final func addPass(_ pass: Data) async throws -> Bool

Asks the customer to confirm adding a Pass to Wallet. - Parameters: - pass: Properly created `.pkpass` data to be added to Wallet. The `passTypeIdentifier` of the pass must be one of the identifiers in the ``CustomerEngagementSession/Configuration/passTypeIdentifiers``. - Returns: `true` if the pass is added to Wallet successfully or the same pass already exists; `false` if the customer declines. - Throws: ``CustomerEngagementSession/Error`` if the request fails.

Skipped declarations

No declarations were skipped in this snapshot.

All ProximityReader types →