Unity IAP App Store Connect rejection

Hi all,

Trying to sort out if I have a problem with my build or there is a problem with my sequencing for the App Store (iOS)

Unity’s IAP won’t recognize a product until it exists on App Store Connect, however App Store Connect won’t publish the product until they are reviewed with a submitted binary.

I submitted a binary with my first product for review and the app was rejected for “completeness” because the product was unavailable.

I asked for clarification and they sent a screenshot back showing the store page in the game with the IAP UI in the state I would expect for no products (the buttons say “unavailable” and are disabled)

They sent the following:

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.

This seems like Apple’s review process does not play nicely with Unity’s recommended process - but I must be missing something there?

Seems like they won’t approve the app unless it can be tested before the product exist in App Store Connect, but Unity won’t recognize the product until it exists in App Score Connect?

I can’t be the only one with this problem, or I must be missing something… or there is something else wrong with my build.

Suggestions much appreciated!

Hello @AndrewAtCandlelight

Could you review that you have followed these steps:

If this still doesn’t work, could you share a picture of your product on the App Store Connect and how you are adding this product with IAP?

When testing your app, do you also get the buttons saying “unavailable”? When you do, there should be a log starting with "Unavailable product ", can you share this line?

Have you looked into sandbox accounts or test flight? (which auto creates a sandbox account behind the scenes)

I find sandbox accounts a little trickier to setup, but more flexible (for example, fake purchases can be cancelled\refunded, accounts easily changed)

https://developer.apple.com/documentation/storekit/testing-in-app-purchases-with-sandbox

Test flight is easier to setup, but less flexible (for example, fake purchases can’t be refunded as far as I’m aware)

https://developer.apple.com/help/app-store-connect/test-a-beta-version/testflight-overview

Submit a test flight to an internal group first, test what you can (IAP won’t work yet)

Then submit a test flight to an external group, which triggers a review by Apple along with any IAP products (without any of it going public)

In summary…

Test what you can (in terms of purchasing) with Unity’s editor ‘store’ then move onto sandbox and finally test flight.

If you’re using established purchasing code (that is, it’s an abstract\generic layer) then you can pretty much bypass sandbox and go straight to test flight in my experience.

@Yannick_D @PeachyPixels

Thanks both for your responses!

As I suspected it seems the issue was AppStore Connect based - my financial info needed updating. This causes products to fail, though I didn’t see any errors that pointed me in that direction. Only figured it out because of a different Unity forum post from years ago.

Probably a case of RTFM for me, as the first step in the Apple provided guide Yannick linked is to set up your financial info - I’d read that several times, tbh I just assumed my financial info was still good and didn’t consider it to be a possible cause for my issue.

@Yannick_D the above is unrelated to the original error I was seeing running tethered from XCode, but it archives clean and works as intended on the app store so shrug?

@AndrewAtCandlelight

Pleased to hear you resolved the issue.

When your post made no mention of sandbox or test flight, I wrongly assumed those steps had been skipped, so apologies.