(iOS + StoreKit) Can I detect when I'm in the sandbox?

前端 未结 3 948
谎友^
谎友^ 2020-12-08 14:47

I\'ve got in-app purchases working just fine, and I\'m going the server validation route. The server needs to know whether I\'m in the sandbox or not, so for now I\'m just s

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 15:03

    After a bit of digging I found this from Apple's 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.

    So it looks like I should axe the &sandbox parameter completely and just do that. I really had to dig for this answer so I'm posting it here in hopes that someone else runs across it!

提交回复
热议问题