IAP verifyReceipt url 应该是 sandbox 还是 buy url 在服务器上提交应用程序到 Apple Store 时?

IAP verifyReceipt url should be sandbox or buy url on the server when submitting the app to Apple Store?

我正要将我的 iOS 应用程序提交到 Apple Store,但有一些不清楚的地方我无法弄清楚。

在测试过程中我使用了Sandbox。我了解 1 个月订阅的到期日期等于沙盒中的 5 分钟。因此,当我购买产品时,应用程序会向我的服务器发送请求以验证收据。服务器然后调用“https://sandbox.itunes.apple.com/verifyReceipt”url 和我收到的到期日期:

购买日期:2020 年 7 月 3 日 - 16:45 到期日期:07/03/2020 - 16:50

我正在按照 Apple 的建议在服务器上进行收据验证。

完成IAP开发后,我将服务器上的url更新为“https://buy.itunes.apple.com”。然后我尝试使用我当前的 Apple Id 购买产品 - 而不是使用 Sandbox 帐户。这次应用返回 "Cannot connect to iTunes" 错误。这是有道理的,因为我的应用程序还没有在苹果商店

我的问题是,当我提交我的应用程序时,Apple 将如何测试我的应用程序?我应该在服务器上保留“https://sandbox.itunes.apple.com/verifyReceipt”url,然后在 Apple 批准该应用程序后将 url 替换为“https://buy.itunes.apple.com”吗?这部分比较混乱。

Apple 声明如下:

Important

Verify your receipt first with the production URL; proceed to verify with the sandbox URL if you receive a 21007 status code. Following this approach ensures that you do not have to switch between URLs while your application is tested, reviewed by App Review, or live in the App Store.

Source

所以回答你的问题:你使用两个 urls。首先,您使用生产 url 进行验证,当您收到 21007 响应时,您使用沙箱 url.

进行验证