4

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?

Castor
  • 534
  • 2
  • 11
  • 26
  • 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? – Castor 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. – Castor Aug 08 '18 at 08:14
  • okk. Thank you. i got it – vijju Aug 08 '18 at 09:59

2 Answers2

10

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
  • 6,777
  • 3
  • 41
  • 63
0

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
  • 342
  • 2
  • 11