6

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?

Capella
  • 881
  • 3
  • 19
  • 32
  • Hii Soft Dev . Did you find solution for this completely? I have the same issue.when ever user clicks the add cards to wallet then it directly to the wallet app for add the cards. please suggest me. – vijju Aug 07 '18 at 04:34
  • @vijju Did you check the below answer? – Capella Aug 08 '18 at 03:18
  • For that, any special entitlements are needed from Apple. com.apple.developer.payment-pass-provisioning is this needed. – vijju Aug 08 '18 at 05:12
  • @vijju This post is for asking the way to open wallet app. And the answer I accepted works well. – Capella Aug 08 '18 at 08:14
  • okk. Thank you. i got it – vijju Aug 08 '18 at 09:59

2 Answers2

12

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.

Mark
  • 7,167
  • 4
  • 44
  • 68
1

Code in Objective C, same as @Mark answer:

First you have to import PassKit:

@import PassKit;

And call func to open Wallet App, func:

-(void) openAppleWalletApp {
    PKPassLibrary * wallet = [[PKPassLibrary alloc] init];
    [wallet openPaymentSetup];
    
}
pajtimid
  • 518
  • 1
  • 4
  • 13
  • Thanks so much, nice to see Objective-C is still alive, I love coding in it. Presumably Apple will eventually only support Swift? – Supertecnoboff Jan 17 '23 at 16:53