Yesterday this error started appearing when testing my apps from nowhere.
It's happening upon calling restoreCompletedTransactions()
at app startup.
What does this error mean and is there anything I can do to avoid this error?
Yesterday this error started appearing when testing my apps from nowhere.
It's happening upon calling restoreCompletedTransactions()
at app startup.
What does this error mean and is there anything I can do to avoid this error?
It's apple's internal servers that are causing this. From what I researched a few hours ago, this happens on SOME testers (apparently not all). And it only happens on test accounts, so production app is safe.
I have asked an Apple using Apple Developer Center, and they replied to me like this:
Hello Bartlomiej Semanczyk,
I’ve review the problem description presented below. This looks like a bug report issue to be investigated by the App Store Server QA engineers. The error string presented in the Stack Overflow page is new to me. However, this issue needs to be investigated by the Server QA team as it’s likely that the server is issuing this error string. Please follow these instructions to install the StoreKit profile and capture a console log, then submit a bug report. I will review the bug report and make sure that it’s forwarded to the Server QA team for investigation. BTW, I just ran an old StoreKit sample ad I’m not seeing this issue. I wonder if the issue only occurs with new in-app purchase identifiers.
and here they attached a lot of instructions ho to install StoreKit and capture the device console log.
One of my TestFlight users has also been experiencing this error, while others haven't strangely. Most of them are on ios 13.6.1. Others on the Apple dev forum thread (where I found your link to here) are experiencing this in production as well. Seems this problem has started roughly 48 hours ago with no concrete answer from Apple. At any rate, to answer your question:
When setting up your server side to communicate with Apple to check the receipt, you need to hit the production api first:
https://buy.itunes.apple.com/verifyReceipt
You will get a json response from Apple that includes a "status" key and a corresponding numerical value. If the "status" returns "21007" it means the receipt is for Sandbox not production. You then hit the testing api instead:
I have received the same error on my test device with an old sandbox user. The following steps have kind of solved this issue for me:
I know this may not be a definite solution but I just wanted to share this information with the hope of being helpful. I will update my answer once the app's latest version is approved by the App Store.
This happened to me also when installing a build from TestFlight. I had a sandbox account configured but that account was not part of the team the build belonged to. So I logged out of the sandbox account and the dialog disappeared. I logged in with proper sandbox account that belong to the team, even then I didn't get the dialog.
I know that when installing the build from TestFlight it uses the actual iTunes store account configured on the device, but my guess is that it has something to do with the sandbox account. To avoid this dialog remove the sandbox account when installing the build from TestFlight or use a proper sandbox account that belongs to the team or account that the build belongs to
Just check the bundle id in appstoreconnect/App information , make sure is the same with your App bundle id
Today I encountered a 21105 response code when validating a receipt against Apple's server for a sandbox user and found this thread.
In my case, I had just recently cleared the purchase history for all of the sandbox testers in my Apple Developer Account, so I assume that because I cleared the purchase history, the receipt data is no longer valid.
At least according to Apple's documentation on what valid status codes can be returned, they don't have a definition for this one specifically as it falls under their range of internal data access errors:
Status codes 21100-21199 are various internal data access errors.
Anyone with the appropriate access rights can clear the purchase history for a sandbox tester under "App Store Connect" → "Users and Access" by first clicking "Edit" and then selecting a user account to enable the "Clear Purchase History" button:
That said, after making another in-app purchase with the same user account, all following receipt validation calls were successful.