我正在尝试设置我的服务器与应用程序商店通知。这样我就可以得到通知时,用户退还他们的应用程序内购买。https://developer.apple.com/documentation/appstoreservernotifications/receiving_app_store_server_notifications〈-指导线,我现在正在寻找。
The version 2 response body, responseBodyV2, contains a signedPayload that’s cryptographically signed by the App Store in JSON Web Signature (JWS) format. The JWS format increases security and enables you to decode and validate the signature on your server. The notification data contains transaction and subscription renewal information that the App Store signs in JWS. The App Store Server API and the StoreKit In-App Purchase API use the same JWS-signed format for transaction and subscription status information. For more information about JWS, see the IETF RFC 7515 specification.
根据文章,似乎我必须在一个URL中保存一个签名的有效负载代码,我与我的App Store Connect. https://gist.github.com/atpons/5279af568cb7d1b101247c02f0a022af〈共享-代码应该是这样的
所以我的问题是,
我需要做一些新的私钥,并与服务器开发人员共享?看起来像我们存储的密钥从这里https://www.apple.com/certificateauthority/,并使用它,每当我们请求?我如何获得通知?我应该只是期望expected response json structure这种通知将来到我与我的应用程序商店连接共享的URL。谢谢你阅读我的问题!
2条答案
按热度按时间rbl8hiat1#
好吧,现在,我可能花了一天的时间在它上面,但是我终于在一堆Java和Ruby代码片段之间找到并组成了一个工作的NodeJS代码。希望其他人能从中受益。
toiithl62#
下面是步骤:
1.获取Apple根证书:加权https://www.apple.com/certificateauthority/AppleRootCA-G3.cer
1.创建pem文件:openssl x509 -通知目录输入/苹果根CA-G3.cer输出/苹果根.pem
1.运行代码: