Class

PKPassLibrary

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

Overview

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

Topics

Accessing Passes

class func isPassLibraryAvailable()

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

func passes()

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

func containsPass(PKPass)

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

func pass(withPassTypeIdentifier: String, serialNumber: String)

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

func passes(of: PKPassType)

Returns the passes of the specified pass type.

func remotePaymentPasses()

Returns a list of passes stored on a remote device.

Adding and Removing Passes

enum PKPassLibraryAddPassesStatus

Statuses used when adding passes to the pass library.

func canAddFelicaPass()

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

func removePass(PKPass)

Removes the pass from the user’s pass library.

func replacePass(with: PKPass)

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

Adding Payment Passes

func canAddPaymentPass(withPrimaryAccountIdentifier: String)

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

func openPaymentSetup()

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

Activating Payment Passes

func isPaymentPassActivationAvailable()

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

Presenting Passes

func present(PKPaymentPass)

Presents your payment pass for use in-store.

Suppressing Automatic Pass Presentation

class func isSuppressingAutomaticPassPresentation()

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

enum PKAutomaticPassPresentationSuppressionResult

The result of an attempt to suppress automatic pass presentation.

typealias PKSuppressionRequestToken

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

Notifications

static let PKPassLibraryDidChange: PKPassLibraryNotificationName

Posted after the pass library has been changed.

static let PKPassLibraryRemotePaymentPassesDidChange: PKPassLibraryNotificationName

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).

struct PKPassLibraryNotificationName

Types of notifications issued by a pass library instance.

Deprecated

func activate(PKPaymentPass, withActivationCode: String, completion: ((Bool, Error) -> Void)? = nil)

Activates a payment pass using the provided activation code.

Deprecated
class func isPaymentPassActivationAvailable()

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

Deprecated

Relationships

Inherits From

Conforms To

See Also

Passes

class PKPass

An object that represents a single pass.

class PKSuicaPassProperties

Represents the properties of a Suica pass, a card used for transportation in Japan.

class PKObject

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