Class

PKPassLibrary

Provides an interface to the user’s library of passes.

Declaration

@interface PKPassLibrary : NSObject

Overview

The PKPassLibrary is not thread-safe. Use instances of this class only on a single thread.

Topics

Accessing Passes

+ isPassLibraryAvailable

A Boolean value that indicates whether the pass library is available.

- passes

Returns the passes in the user’s pass library to which the app has access.

- containsPass:

Indicates whether the user’s pass library contains the specified pass.

- passWithPassTypeIdentifier:serialNumber:

Returns the pass with the given pass type identifier and serial number.

- passesOfType:

Returns the passes of the specified pass type.

- remotePaymentPasses

Returns a list of passes stored on a remote device.

Adding and Removing Passes

- addPasses:withCompletionHandler:

Presents lightweight UI for adding multiple passes at once.

PKPassLibraryAddPassesStatus

Statuses used when adding passes to the pass library.

- canAddFelicaPass

Returns a Boolean value that indicates whether the library can add Felica passes.

- removePass:

Removes the pass from the user’s pass library.

- replacePassWithPass:

Replaces a pass in the user’s pass library with the given pass.

Adding Payment Passes

- canAddPaymentPassWithPrimaryAccountIdentifier:

A Boolean value that indicates whether the app can add a card to Apple Pay for the provided primary account identifier.

- openPaymentSetup

Opens the user interface to set up credit cards for Apple Pay.

Activating Payment Passes

- isPaymentPassActivationAvailable

A Boolean value that indicates whether the device supports adding payment passes.

- activatePaymentPass:withActivationData:completion:

Activates a payment pass using the provided activation code.

Presenting Passes

- presentPaymentPass:

Presents your payment pass for use in-store.

Suppressing Automatic Pass Presentation

+ isSuppressingAutomaticPassPresentation

Returns a Boolean value that indicates whether the system is suppressing the automatic presentation of Apple Pay passes.

+ requestAutomaticPassPresentationSuppressionWithResponseHandler:

Prevents the iOS device from automatically displaying the Apple Pay interface.

PKAutomaticPassPresentationSuppressionResult

The result of an attempt to suppress automatic pass presentation.

+ endAutomaticPassPresentationSuppressionWithRequestToken:

Reenables the automatic display of the Apple Pay interface.

PKSuppressionRequestToken

A token representing a request to suppress the automatic presentation of payment passes.

Notifications

PKPassLibraryDidChangeNotification

Posted after the pass library has been changed.

PKPassLibraryRemotePaymentPassesDidChangeNotification

Posted when an Apple Pay card is added to or removed from a device that is paired with the current iOS device (for example, Apple Watch).

PKPassLibraryNotificationName

Types of notifications issued by a pass library instance.

Deprecated

- activatePaymentPass:withActivationCode:completion:

Activates a payment pass using the provided activation code.

Deprecated
+ isPaymentPassActivationAvailable

A Boolean value that indicates whether the device supports adding payment passes.

Deprecated

Relationships

Inherits From

See Also

Passes

PKPass

An object that represents a single pass.

PKTransitPassProperties

The properties of a transit pass.

PKSuicaPassProperties

The properties of a Suica pass.

PKObject

An opaque type that acts as the superclass for the PKPass class.

Supporting Semantic Tags in Wallet Passes

Allow the system to offer Wallet passes to users intelligently by adding machine-readable metadata.