PKAddPassPaymentRequest 无法发送请求
PKAddPassPaymentRequest not able to send a Request
我正在开发 Apple Pay Card 配置 我得到这个继续这个功能从 Apple 服务器获取 nonce 和 nonceSignatures 在尝试在下面的格式中发送 PKAddPassPaymentRequest 没有得到任何东西是格式是更正我发送的内容
PKAddPaymentPassRequest *request = [[PKAddPaymentPassRequest alloc] init];
request.encryptedPassData =[@"XXXXXXXXXXX" dataUsingEncoding:NSUTF8StringEncoding];
request.activationData =[@"XXXXXXXXXXX" dataUsingEncoding:NSUTF8StringEncoding];
request.ephemeralPublicKey =[@"XXXXXXXXXXX" dataUsingEncoding:NSUTF8StringEncoding];
提前致谢。
先决条件:获取所有权利和更新的配置文件。您只能通过 testflight 或 appstore 测试推送配置到生产。您可以从 Apple 请求将沙盒环境放入您的设备。他们可以通过安装配置文件在您的设备中启用 QA env。然后您也可以在 QA 环境中测试推送配置。
满足所有要求后,
1.创建配置并填写所需的详细信息
PKAddPaymentPassRequestConfiguration *config=
[[PKAddPaymentPassRequestConfiguration alloc]
initWithEncryptionScheme:PKEncryptionSchemeECC_V2];
2。创建 PKAddPaymentPassViewController 并呈现它
self.addPaymentPassModal =
[[PKAddPaymentPassViewController alloc]
initWithRequestConfiguration:config delegate:self];
3。实施委托方法。
- (void)addPaymentPassViewController:(PKAddPaymentPassViewController *)controller
generateRequestWithCertificateChain:(NSArray<NSData *> *)certificates
nonce:(NSData *)nonce
nonceSignature:(NSData *)nonceSignature
completionHandler:(void(^)(PKAddPaymentPassRequest *request))handler {
PKAddPaymentPassRequest *paymentPassRequest = [[PKAddPaymentPassRequest alloc] init];
paymentPassRequest.encryptedPassData = [[NSData alloc]
initWithBase64EncodedString:encryptedPassData options:0];
paymentPassRequest.activationData = [activationData
dataUsingEncoding:NSUTF8StringEncoding];
paymentPassRequest.ephemeralPublicKey = [[NSData alloc]
initWithBase64EncodedString:ephemeralPublicKey options:0];
handler(paymentPassRequest);
}
- (void)addPaymentPassViewController:(PKAddPaymentPassViewController *)controller
didFinishAddingPaymentPass:(nullable PKPaymentPass *)pass
error:(nullable NSError *)error {
//Will get called once push provisioning complete
}
我正在开发 Apple Pay Card 配置
PKAddPaymentPassRequest *request = [[PKAddPaymentPassRequest alloc] init];
request.encryptedPassData =[@"XXXXXXXXXXX" dataUsingEncoding:NSUTF8StringEncoding];
request.activationData =[@"XXXXXXXXXXX" dataUsingEncoding:NSUTF8StringEncoding];
request.ephemeralPublicKey =[@"XXXXXXXXXXX" dataUsingEncoding:NSUTF8StringEncoding];
提前致谢。
先决条件:获取所有权利和更新的配置文件。您只能通过 testflight 或 appstore 测试推送配置到生产。您可以从 Apple 请求将沙盒环境放入您的设备。他们可以通过安装配置文件在您的设备中启用 QA env。然后您也可以在 QA 环境中测试推送配置。
满足所有要求后,
1.创建配置并填写所需的详细信息
PKAddPaymentPassRequestConfiguration *config=
[[PKAddPaymentPassRequestConfiguration alloc]
initWithEncryptionScheme:PKEncryptionSchemeECC_V2];
2。创建 PKAddPaymentPassViewController 并呈现它
self.addPaymentPassModal =
[[PKAddPaymentPassViewController alloc]
initWithRequestConfiguration:config delegate:self];
3。实施委托方法。
- (void)addPaymentPassViewController:(PKAddPaymentPassViewController *)controller
generateRequestWithCertificateChain:(NSArray<NSData *> *)certificates
nonce:(NSData *)nonce
nonceSignature:(NSData *)nonceSignature
completionHandler:(void(^)(PKAddPaymentPassRequest *request))handler {
PKAddPaymentPassRequest *paymentPassRequest = [[PKAddPaymentPassRequest alloc] init];
paymentPassRequest.encryptedPassData = [[NSData alloc]
initWithBase64EncodedString:encryptedPassData options:0];
paymentPassRequest.activationData = [activationData
dataUsingEncoding:NSUTF8StringEncoding];
paymentPassRequest.ephemeralPublicKey = [[NSData alloc]
initWithBase64EncodedString:ephemeralPublicKey options:0];
handler(paymentPassRequest);
}
- (void)addPaymentPassViewController:(PKAddPaymentPassViewController *)controller
didFinishAddingPaymentPass:(nullable PKPaymentPass *)pass
error:(nullable NSError *)error {
//Will get called once push provisioning complete
}