Search code examples
iosapplepaywallethuman-interface

iOS how to take user directly to the Wallet app


I'm integrating Apple Pay now and I see iOS Human Interface Guidelines for Apple Pay.

https://developer.apple.com/design/human-interface-guidelines/apple-pay/

Set up Apple Pay Button

How can I open the Wallet app when the user taps a button?


Solution

  • Check out the PKPaymentButton. There are already pre-built buttons for this as part of PassKit.

    let setupButton = PKPaymentButton(type: .setUp, style: .black)
    

    More information can be found at the PKPaymentButton Reference.

    EDIT:

    PKPassLibrary can actually perform the action. You can use it like so:

    let library = PKPassLibrary()
    library.openPaymentSetup()
    

    More information can be found here.

    Note: The above call will only work on a real iOS device.