I'm encountering an issue with in-app purchases in the Sandbox testing environment for our app Answify. Our subscription products were approved on April 9th, 2025, but they are not available when testing in the Sandbox environment.
Problem Description
When using the Product.products(for:) method from StoreKit 2 to request our approved in-app purchase products, an empty array is returned. This happens both with our main app flow and with a direct test that specifically requests the products.
Environment Details
App: Answify (Bundle ID: com.answify.Answify.iphone)
Build: 71 (available in TestFlight)
iOS: 18.4 (iPhone)
Testing date: April 21, 2025
Sandbox accounts tested:
purchase2 [at] it-xpert.be
sandbox [at] it-xpert.be (recently created)
Steps to Reproduce
Login with a Sandbox test account
Launch the Answify app
Navigate to the subscription screen
The app attempts to load products via Product.products(for:), but receives an empty array
The app falls back to displaying dummy products with an error message
Attempted Solutions
I've verified the following:
Correct Sandbox Environment: The app correctly identifies it's running in the Sandbox environment (confirmed via both app logs and UI indicators).
Correct Sandbox Account: I've confirmed in iOS Settings that I'm using the Sandbox account (purchase2 [at] it-xpert.be). I've also tested with a different Sandbox account (sandbox [at] it-xpert.be) with the same results.
Approved Products: All products have been approved since April 9th, 2025, and show as "Ready to Submit" in App Store Connect.
Product IDs: I've triple-checked that the product IDs match exactly between the app and App Store Connect.
Manual Transaction Testing: I've attempted to manually test transactions through the iOS Settings > Developer menu with the product ID "com.answify.subscription.personal" and lot ID "answify_subscriptions". This test also fails with "The product or lot identifier provided is not valid" error.
Local StoreKit Testing: The products load correctly and purchases work when using a local StoreKit configuration file, confirming our implementation is correct.
Relevant Code
Here's the code we use to fetch products:
// In StoreManager.swift
func loadProducts() async {
print("DEBUG: Starting product loading process from App Store")
isLoading = true
error = nil
do {
// 1. Fetch pricing packages from backend
var pricingPackages: [PricingPackage] = []
do {
print("DEBUG: Fetching pricing packages from backend API")
pricingPackages = try await fetchPricingPackages()
print("DEBUG: Successfully received \(pricingPackages.count) pricing packages from backend")
} catch {
print("DEBUG: Error fetching pricing packages from backend: \(error)")
pricingPackages = createHardcodedPricingPackages()
print("DEBUG: Using \(pricingPackages.count) hardcoded pricing packages as fallback")
}
// 2. Load products from the App Store
let productIdentifiers = Set(pricingPackages.map { $0.inAppPurchaseID })
print("DEBUG: Requesting \(productIdentifiers.count) products from App Store with IDs: \(productIdentifiers)")
do {
// Attempt to load products
let storeProducts = try await Product.products(for: productIdentifiers)
print("DEBUG: Successfully loaded \(storeProducts.count) products from App Store")
// Rest of implementation...
} catch let storeKitError {
print("DEBUG: StoreKit error when loading products: \(storeKitError.localizedDescription)")
// Fallback to dummy products...
}
} catch {
// Error handling...
}
}
// Direct StoreKit test (also returns 0 products)
func testStoreKitDirectly() async {
let productIDs = Set([
"com.answify.subscription.personal",
"com.answify.subscription.personal.yearly",
"com.answify.subscription.startup",
"com.answify.subscription.startup.yearly",
"com.answify.subscription.business_monthly"
])
do {
let products = try await Product.products(for: productIDs)
print("DEBUG: Directly received \(products.count) products from StoreKit")
} catch {
print("DEBUG: Direct StoreKit test error: \(error.localizedDescription)")
}
}
Console logs
Here is the relevant console output:
DEBUG: Requesting 5 products from App Store with IDs: ["com.answify.subscription.startup.yearly", "com.answify.subscription.personal.yearly", "com.answify.subscription.startup", "com.answify.subscription.personal", "com.answify.subscription.business_monthly"]
DEBUG: Successfully loaded 0 products from App Store
DEBUG: No products found in the App Store. Switching to dummy products.
DEBUG: Creating dummy products since App Store products couldn't be loaded
DEBUG: Running direct StoreKit product retrieval test
DEBUG: Directly requesting 5 products from StoreKit
DEBUG: Directly received 0 products from StoreKit
Question
Is there any additional step required after product approval to make them available in the Sandbox environment? Could there be an issue with the App Store Sandbox environment itself?
Any guidance would be greatly appreciated. This issue is blocking our testing and release process.
Thank you!
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Subscriptions
StoreKit
App Sandbox