Unable to receive sandbox receipt data

Is anyone facing this issue? Based on the sandbox receipt, this is the only thing i receive:

{"status":21004,"environment":"Sandbox"}

with this limited information. I am not able to credit the in app purchase to the sandbox tester account. This appears on ipad mini 12.4.6 and iphone 6s 13.4.2.


Please advise.

Accepted Reply

Lots of questions. But you never answered the question - do you have an autorenewable subscription IAP as a possibility in the app? If so, you may* need to include the shared secret in requests the Apple server.


* If the receipt has an autorenewable subscription purchase in it you will need the shared secret.

* If the receipt does not include an autorenewable subscription purchase in it but the app has an autorenewable subscription IAP - I am not certain - but I think you still need the shared secret.


A 21004 error occurs if you do not have a shared secret, or you have the wrong shared secret, and you need a shared secret. A 21004 error might also occur if you include a shared secret and you are not supposed to include it. So - good idea - if you have an autorenewable subscritpion in your app either 1) include a shared secret and resubmit without shared secret if you get back a 21004 or 2) don't include a shared secret and resubmit with shared secret if you get a 21004.

Replies

This was a bug back two years ago:

https://forums.developer.apple.com/thread/76301


The 21004 indicates your password is incorrect.

Do you have an autorenewable subscription IAP in the receipt? Might you have such an IAP in the receipt?

If so, is your password included in what you send to the Apple servers and is it the correct password?

If nthere can not be an autorenewable IAP, are you incorrectly adding a password to the package you are sending to the Apple servers?

Thanks PBK for your prompt reply.


What you mean is for subscription i have to include my shared secret when i'm validating the receipt.

1. How about for normal non renewable consumable products? Would it break if I include the shared secret?

2. Does the subscription follows a Apple ID? meaning to say if i subscribe to my app using email@domain.com, and i change device and sign in using email@domain.com, i would continue to enjoy this subscription on another device?

3. Do I need to do this?
Code:
check receipt if its subscription first with shared secret
if (21004)

{

check if its non renewable consumable product without shared secret

}

4. If 3 is the right way, would it count the non renewable consumable product as being bought twice?


Really appreciate your help.

Lots of questions. But you never answered the question - do you have an autorenewable subscription IAP as a possibility in the app? If so, you may* need to include the shared secret in requests the Apple server.


* If the receipt has an autorenewable subscription purchase in it you will need the shared secret.

* If the receipt does not include an autorenewable subscription purchase in it but the app has an autorenewable subscription IAP - I am not certain - but I think you still need the shared secret.


A 21004 error occurs if you do not have a shared secret, or you have the wrong shared secret, and you need a shared secret. A 21004 error might also occur if you include a shared secret and you are not supposed to include it. So - good idea - if you have an autorenewable subscritpion in your app either 1) include a shared secret and resubmit without shared secret if you get back a 21004 or 2) don't include a shared secret and resubmit with shared secret if you get a 21004.

Thank you. This helped me. It was due to shared secret was not added during the validation. Yes I do recently added a autorenewable subscription IAP into my app and was testing it with my sandbox user and that probably explain why this happen.


I would monitor and update again if there's any other errors along the way. Thanks PBK