Apple Pay In-App Provisioning Card

扶醉桌前 提交于 2019-12-06 14:19:49

问题


I am developing an App that allows a user to Add Cards a payment pass in the Wallet via the App. In order to do this, you must be request Apple to add the following entitlement

I'm also using "com.apple.developer.payment-pass-provisioning" these entitlements in my app Apple granted this entitlement for my team ID modified my provisioning profile with this entitlement enabled.

Trying to invoke the Add card screen in the Wallet app from My application using the below code

PKAddPaymentPassRequestConfiguration *request;
request.cardholderName  = @"xxxxxxxx";
request.primaryAccountSuffix = @"xxxx";
request.localizedDescription = @"This will add the card to Apple Pay";
request.primaryAccountIdentifier = @"test";
request.paymentNetwork = @"Test";

PKPassLibrary *libra;
[libra openPaymentSetup];

PKAddPaymentPassViewController *vc = [[PKAddPaymentPassViewController alloc] initWithRequestConfiguration:request delegate:self];
vc.delegate = self;
[self presentViewController:vc animated:YES completion:nil];

App is getting crash. with the error passing Nil value to the viewcontoller.


回答1:


First create PKAddPaymentPassRequestConfiguration using an encryption scheme. Then create PKAddPaymentPassViewController using this config. Update all required details in the config variable.

PKAddPaymentPassRequestConfiguration *config =[[PKAddPaymentPassRequestConfiguration alloc] initWithEncryptionScheme:PKEncryptionSchemeECC_V2];




回答2:


Have to Initialise the PKPassLibrary & PKPaymentPassRequestConfiguration replaced PKPassLibrary *libra; with PKPassLibrary *libra = [[PKPassLibrary alloc] init];



来源:https://stackoverflow.com/questions/50173886/apple-pay-in-app-provisioning-card

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!