Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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/ios/human-interface-guidelines/technologies/apple-pay/

enter image description here

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

like image 398
Castor Avatar asked Dec 19 '22 12:12

Castor


1 Answers

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.

like image 134
Mark Avatar answered Dec 28 '22 09:12

Mark