Nabeel
Nabeel

Reputation: 1011

In app purchase rejection due 21104 Error StoreKit 2 - SwiftUI

I implemented a Subscription product and an In app purchase product in my app with StoreKit 2. It is working fine with StoreConfiguration and also it is working fine when I uploaded to TestFlight. When I sent the app for review. They rejected it and asked me to resolve this issue.

Guideline 2.1 - Performance - App Completeness

We found that your in-app purchase products exhibited one or more bugs which create a poor user experience. Specifically, an error message displayed when we attempted to purchase the in-app purchase. Please review the details and resources below and complete the next steps.

Review device details:

  • Device type: iPad

  • OS version: iOS 16.3.1

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.

They also attached a screenshot with this error below:

Error while buying

I am not sure what they are asking me to do. They are referring to Receipt validation on server when I am not using server to do anything with in app purchases.

Can anybody guide what they are asking me to do?

Thanks Nabeel

Upvotes: 0

Views: 913

Answers (1)

Nabeel
Nabeel

Reputation: 1011

It appears that the issue with the app not displaying products was related to a lack of internet connection. Specifically, the app was not fetching products from App Connect due to the lack of connection, resulting in the error message or empty product list. This problem only occurred when the device was restarted and immediately opened the app while still in the process of connecting to Wi-Fi.

To address this issue, the solution involved writing a script to check for an internet connection and waiting for a few seconds before attempting to fetch products again. This strategy resolved the problem and the app was approved and published.

However, another issue arose where the products were not displaying on the App Store, but they were displaying on TestFlight. Upon checking, it was found that the products were waiting for review in App Store Connect. To resolve this issue, new products were created, the old ones were deleted, and the app was updated for the new products. The new version was then sent for review and approved, finally displaying the products on the App Store.

Upvotes: 0

Related Questions