Contents

TN3185: Troubleshooting In-App Purchases availability in Xcode

Inspect your active StoreKit configuration file for unexpected configurations.

Overview

When using Setting up StoreKit Testing in Xcode to test your In-App Purchases, your app may not display its products. StoreKit Testing in Xcode is a local test environment for testing In-App Purchases without requiring a connection to App Store servers. To set up testing in this environment, add a local or synced StoreKit configuration file that contains In-App Purchases to your Xcode project. For more information, see Setting up StoreKit Testing in Xcode. When you Setting up StoreKit Testing in Xcode in your Xcode project, this file becomes active. StoreKit uses data saved in the active configuration file when your app calls StoreKit APIs in the test environment. For more information, see Setting up StoreKit Testing in Xcode.

To offer In-App Purchases in your app, call products(for:) with a list of product identifiers (Product ID) matching these products in the test environment. Product.products(for:) returns an array that includes an instance of Product for each of the In-App Purchases. Update your app’s UI with these returned instances, which contain all In-App Purchase information set up in the active configuration file for your app.

If Product.products(for:) fails to return a Product instance for your In-App Purchases, it may be due to the following reasons:

  • Your In-App Purchases are missing or don’t exist in the active StoreKit configuration file.

  • You set up the test environment to simulate a load products failure scenario.

Validate your product identifier list

Inspect the active StoreKit configuration file in your Xcode project. Confirm each product identifier in your list matches the product identifier of an In-App Purchase configured in this file.

Disable the Simulated StoreKit Load Products failure setting

A Setting up StoreKit Testing in Xcode includes settings you can use to specify test conditions or scenarios for your In-App Purchases such as Load Products. When you enable Load Products, the test environment simulates the load product failure scenario you specified such as network error. Calling products(for:) in your app throws a StoreKitError. When you disable this setting, the function returns all your In-App Purchases that exist in the active configuration file. For more information, see Testing in-app purchases with StoreKit transaction manager in Xcode in Testing in-app purchases with StoreKit transaction manager in Xcode.

To prevent the test environment from simulating a load products failure scenario, perform these steps in your Xcode project:

  1. In the Project navigator, select your active StoreKit configuration file.

  2. Click Configuration Settings.

  3. Scroll down to Simulated StoreKit Failures.

  4. Disable the Load Products setting.

Revision History

  • 2025-04-29 First published.

See Also

Latest