gpt4 book ai didi

ios - (iOS + StoreKit) 我可以检测到我何时在沙盒中吗?

转载 作者:IT王子 更新时间:2023-10-29 07:58:18 26 4
gpt4 key购买 nike

我的应用程序内购买工作正常,我正在执行服务器验证路线。服务器需要知道我是否在沙箱中,所以现在我只是向它发送一个“&sandbox=1”参数。当然,当应用程序的完整版本发布时,我不会发送此参数。

我宁愿不在我的应用程序中硬编码,因为这会使将来的测试变得困难,而且在将构建提交给 Apple 之前要记住更改的另一(大)事情。

有没有办法让我询问 StoreKit 我是否在沙箱中,然后我可以确定是否需要将此参数发送到我的服务器?或者,还有其他处理服务器验证的最佳做法吗?

再考虑一下,我是否应该让服务器始终先检查实时系统,然后再检查沙箱?如果 Apple ID 在实时系统和沙盒系统之间隔离,那么它不会造成任何伤害,对吗?

谢谢。

最佳答案

经过一番挖掘,我从 Apple 的 Technical Note TN2259 中找到了这个:

How do I verify my receipt (iOS)?

Always 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 being tested or reviewed in the sandbox or is live in the App Store.

所以看起来我应该完全取消 &sandbox 参数,然后就这样做。我真的不得不挖掘这个答案,所以我把它张贴在这里,希望其他人能看到它!

关于ios - (iOS + StoreKit) 我可以检测到我何时在沙盒中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9677193/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com