we are submittion to AppStore with IAP 4.1 for the first time. Our app was already twice rejected with the following comment:
Guideline 2.1 - Performance - App Completeness
We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad running iOS 15.1 on Wi-Fi.
Specifically, your purchase details for your in-app purchases still displays “For testing purposes only. You will not be charged for confirming this purchase”.
Next Steps
When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.
Resources
You can learn more about testing in-app purchase products in your development sandbox environment in App Store Connect Developer Help.
For more information on receipt validation, please see What url should I use to verify my receipt? in the In-App Purchase FAQ.
Learn how to generate a receipt validation code in App Store Connect Developer Help.
We did everything accordingly to the InAppPurchases documentation and we have got no idea why the IAP goes into sandbox purchase mode when reviewer is checking the app. According to documentation Sanboxing should only happen when one of our TestFlight team members makes a purchase, is this correct?
Yes, you are correct. Did you test via TestFlight? That does look like a reviewer mistake actually. Does IAP work correctly for you with a non-tester? It would be worth the $1.99 charge Also, it may be boilerplate text, do you have receipt validation? They may inject a fake receipt during the review process to confirm.
Hi @JeffDUnity3D and thanks for your reply. I tried with a non-tester account and the purchase failed. However, this is expected, as this might be due to the fact that this is our initial submission (i.e. the IAP on AppStore is not “live” yet as it did not went through the reivew. Yes, we have got receipt validation mechanism implemented.
What do you mean by “did I test via TestFlight”. I removed TestFlight app from my IPad and deployed new build to my IPad straight from my Mac. I also removed my AppleId email (other than the non-tester mentioned above) from Internal Testers and I expired all builds on TestFlight (in AppStoreConnect). Does this mean that TestFlight is off?
Despite all this steps, when I make IAP with my AppleId I still get IAP via Sandbox environmet (although after providing credentials it rejects it). But the question is why it even goes into Sandbox purchase in the first place? My only suspicion is that the my AppleId is also the one, which I have got Apple Developer Program registered with.
But that is the whole point, we have tested the app in TestFlight and IAPs worked OK for us. The problem is when we submit the app to Apple for the review. They say that:
“Specifically, your purchase details for your in-app purchases still displays “For testing purposes only. You will not be charged for confirming this purchase”.”
and later they confirm that they use regular account.
“our rejection is still valid as we are still seeing the same text () display when attempting to make an in-app purchase on a regular account.”
You had not mentioned you tested in TestFlight, only that you “removed the TestFlight app” (there’s an app for that), thank you for sharing. I have not heard of this issue previously. If IAP is working in your testing, Apple should be able to approve it. There is no “flag” in Unity IAP that points to Sandbox, the code is exactly the same. Personally I think that the reviewers SHOULD see that message, I doubt they are going to actually make a purchase to test your game. Unfortunately my only suggestion would be to try again, or get some direction from Apple how to proceed.
we have received a screenshot from app reviewer and seems that he is clearly getting into Sandbox mode with his purchase. I have tested the app with Unity IAP both 4.1 and 3.2.3, the result was the same - app rejected.
I have attached our IAP related code. There is nothing specific about it but we would be very gratful if you could please have a quick look.
Beside this code, are there any other IAP related settings, which you are aware off, which could cause such behaviour on reviewer side (certifacates, profiles, keys etc.)?
Finally, is this is how Unity’s IAP packages handles receipts:
“When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code “Sandbox receipt used in production,” you should validate against the test environment instead.”