1
votes

I am about to submit my iOS app to Apple Store but there are some unclear points that I couldn't figure it out.

During the testing process I used Sandbox. I understand that a 1 month subscription's expiry date equals to 5 minutes in Sandbox. So when I purchase a product, the app sends a request to my server to validate the receipt. The server then calls the "https://sandbox.itunes.apple.com/verifyReceipt" url and the expiry date I receive like:

Purchase Date: 07/03/2020 - 16:45 Expires Date: 07/03/2020 - 16:50

I am doing the receipt validation on server as Apple suggested.

After I completed the IAP development, I have updated the url on server as "https://buy.itunes.apple.com". Then I tried to buy a product with my current Apple Id -not with a Sandbox account. This time the app returned "Cannot connect to iTunes" error. It make sense because my app isn't in Apple Store yet

My question is, when I submit my app how will Apple test my app? Should I keep the "https://sandbox.itunes.apple.com/verifyReceipt" url on the server and then once Apple approves the app replace the url with "https://buy.itunes.apple.com"? This part is confusing.

1

1 Answers

4
votes

Apple states the following:

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

So to answer your question: you use both urls. First you validate with the production url and when you receive a 21007 response you validate with the sandbox url.