We are experiencing a critical issue where StoreKit 2 is returning empty products when using Product.products(for:), specifically on devices running iOS 18.4.
This issue does not occur on iOS 18.3 or earlier.
Steps:
Created a subscription product (e.g. "upm1") in App Store Connect
Confirmed the product is active, localised, and part of a valid subscription group
Call the following Swift code using StoreKit 2:
Task {
do {
let products = try await Product.products(for: ["upm1"])
print(products)
} catch {
print("Error: (error)")
}
}
4. Result: products is an empty list.
This regression is blocking subscription testing on iOS 18.4.
Kindly someone please advise on a potential fix or workaround.
StoreKit Test
RSS for tagCreate and automate tests in Xcode for your app's submission and in-app purchase transactions.
Posts under StoreKit Test tag
94 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hi,
I have a couple of questions in regards to testing in-app purchases. I tested the subscription on a device but I'm not sure how to reset so I can test again. I didn't see the subscription in device settings or in Debug -> StoreKit -> Manage Subscriptions window. Additionally, I was wondering if there was a way to detect the subscription being made. I implemented this, but I'm not sure if that will work:
.onChange(of: Product.SubscriptionInfo.RenewalState.subscribed) {
if Product.SubscriptionInfo.RenewalState.subscribed == .subscribed {
}
}
Hi everyone,
I’m using StoreKit 2 with .storeButton(.visible, for: .policies) inside my SubscriptionStoreView. The buttons appear correctly, but when tapped, a sheet opens that says “Terms of Service Unavailable” or “Something went wrong. Try again.”
I’ve already added the required URLs (Privacy Policy and Terms of Use) in App Store Connect under App Information, but they still don’t show in the sheet.
Does anyone know how this is supposed to work?
• Are the URLs pulled directly from App Store Connect?
• Do they only appear correctly in production?
• Or do we need to manually set them in code for testing/TestFlight?
Any insight would be greatly appreciated — just want to make sure everything is in place before submitting for review. Thanks!
Topic:
App Store Distribution & Marketing
SubTopic:
App Review
Tags:
StoreKit Test
App Review
StoreKit
In-App Purchase
Hi everyone,
I’m facing a recurring issue with my macOS app being rejected during App Store review, and I’d really appreciate any guidance.
The subscription flow in my app is implemented using StoreKit, and everything works perfectly in our development environment using a StoreKit configuration file. It also behaves as expected in Sandbox testing and TestFlight — I even had few beta testers confirm that the subscription information is displayed correctly and the purchase flow completes without issues.
All required subscription details are configured in App Store Connect:
• Subscription duration and the description of the services offered
• Price and price per unit where applicable
• Paid apps agreement and related forms are correctly filled
However, when the app is submitted for review, the subscription screen fails to display the expected information. From what I can tell, the product information fails to load from the App Store in the review environment — even though everything is working fine on our side.
We’ve already submitted a video to Apple showing the subscription UI working in the Sandbox environment, but the app continues to be rejected under guideline 3.1.2 due to missing subscription info in the binary.
Is anyone else experiencing similar behavior during review? Could there be a caching issue or delay in StoreKit syncing for newly configured products?
Any help or suggestions are very welcome. Thanks in advance!
Hi,
Currently, instead of using a real device and test account for in-app purchase testing, we are using Products.storekit with the Simulator.
Our app offers a subscription plan with a 3-day free trial.
We would like to simulate the following test scenarios:
User cancels the subscription within the 3-day free trial period.
User cancels the subscription after the 3-day free trial period.
However, in Xcode, under Debug > StoreKit > Manage Transactions..., we couldn’t find an option to simulate a subscription cancellation.
There is an option to refund the purchase, but we believe this is not the same as a cancellation.
Do you have any idea how we can simulate these two cases using Products.storekit and the Simulator?
Thanks in advance!
Hi everyone,
I’ve been struggling for days to get my in-app subscriptions approved, and I could really use some clarity or guidance from other developers or Apple engineers.
Everything works fine in development (debug builds with sandbox). The issue starts when testing via TestFlight or during App Store Review.
When Apple reviewers attempt to subscribe, my backend returns:
"transaction id not found"
As a result, I keep getting rejected under Guideline 2.1 (App Completeness) with this note:
“When tapped to make the purchase, an error still appeared... your server needs to handle a production-signed app getting receipts from Apple’s test environment...”
Topic:
App Store Distribution & Marketing
SubTopic:
App Review
Tags:
Subscriptions
App Review
StoreKit Test
StoreKit
Three main questions:
How do I know I'm using my sandbox account in my app because when signing in, it only shows my normal apple account?
How do I make sure I configured my subscriptions correctly in app store connect?
How do I test without local storekit configs?
Some context:
I created a paywall (using a 3rd party service, superwall) for my app and everything seems to work when using local storekit configs. I submitted for review and the reviewer is having problems with purchasing because my paywall can't find the product I set up in app store connect.
I have been trying to debug. I set up a sandbox tester account and can confirm that I am logged in my phone's developer settings. But when I log in my app, the sign in with apple pop up only gives the choice to sign in with my apple ID. Is this normal? Does apple just treat these accounts the same?
Also, I can't seem to pull subscription info from app store connect when creating a synced storekit config. I created a new subscription in app store connect, so now I have two, a test and a weekly one. When I create a local storekit config and sync from the appstore, only my test one shows. For context, the weekly subscription shows up as "waiting for review" while test shows up as "ready to submit". Idk if that makes a difference.
I highly suspect I misconfigured something with my in app subscriptions. I'm trying to replace superwall with my own built in paywall. But I can't seem to pull any product from the app store unless I use a storekit config, but even then, my weekly one doesn't show up.
Plz help.
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Subscriptions
StoreKit Test
StoreKit
I have an app that unlocks content based on in-app purchases, both one-time payments and subscriptions.
Recently, I added new subscription products, both for distribution in App Store Connect and in the configuration file in XCode to be able to test it, declaring it in the scheme.
Since the beginning of development, I have had issues with subscriptions. Every time I close the app and reopen it, in order for the app to recover which subscription is active, I have to run the purchase function. This doesn’t happen with purchases or in the production environment, where it works fine.
I’ve now implemented SubscriptionStoreView, so I don’t depend on my business logic, in case I’m doing something wrong in the code. This view never remembers which product I’ve already purchased. Currently, in a version deployed to my phone from XCode, it doesn't even process the payment.
On macOS, the experience is even worse. On iPad, through TestFlight, I haven’t even been able to test payments at all.
Topic:
App Store Distribution & Marketing
SubTopic:
General
Tags:
Xcode
StoreKit Test
StoreKit
TestFlight
I have an app which is already on App Store with In-app purchase. Now I want to integrate In-app purchase in my another app for the same products as in the existing app. Both the apps are using same Apple Account. Can I reuse those Product Ids from the first app in the second one. If yes, what is the ways to use them.
Thank you in advance.
Upon updating to Xcode 16.3, my StoreKit2 unit testing suite encountered a malfunction.
let result = await product.purchase()
The code snippet above simply halts execution, preventing the task from progressing. In a regular environment, everything appear to function correctly.
We are experiencing an Unknown Error (error code 0) when testing purchases in the Apple Sandbox environment.
The error does not occur every time, but it fails with an Unknown Error in approximately 8 out of 20 attempts.
Due to this issue, our app is failing to pass Apple’s review.
Issue Details
This issue only occurs in the Apple Sandbox environment.
After attempting a purchase, the Apple payment API returns SKPaymentTransaction Unknown Error.
Returned error code: SKErrorUnknown (error.code 0).
This problem is preventing us from conducting proper payment tests and getting approval from Apple.
Would it be possible to receive support or any solutions for this issue?
I've been struggling to work with the Storekit framework and specifically to find the current Storefront used by the user of the app.
Context : My app needs to behave differently depending on the country of the user.
For me relying on Locale.current.region?.identifier does not seem very reliable, the user can change it really easily.
I'm trying to use the Storekit framework like so :
if let storefront = await StoreKit.Storefront.current{
return storefront.countryCode
}
As per Apple's Storekit documentation :
Use current to determine a customer's current storefront region and offer in-app products suitable for that region. You maintain your own list of product identifiers and the storefronts in which you make them available.
But I just can't find out what I need to change in my current configuration to get another country. The code keeps returning my original storefront (which is France)
I've tried login in with a sandbox user defined on another country. Changed all settings on my device to another country. Changed my Apple's account region as described here. Also tried to logout from everything.
The only thing that works is setting a local .storekit file as described here and changing the default storefront.
Is Xcode overriding the default storefront when building on debug or TestFlight? does anyone know how can I test different storefronts with sandbox users without the local storekit file ?
Thank you in advance.
Hi, I have a problem with StoreKit regarding in-app subscription purchases. When I upload the app to TestFlight and during the review process, it doesn’t work on a real device. However, it works fine on the simulator. I get the error: "Subscription unavailable" (see image). Does anyone know what might be causing this and how to fix it? Please help!
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Subscriptions
StoreKit Test
StoreKit
In-App Purchase
Problem Description:
1、I have two sandbox accounts from different countries. Account A is from Mainland China (CHN), and Account B is from the United States (USA). When I switch the sandbox account from Account A (CHN) to Account B (USA) in the system settings and restart the app, the value of SKPaymentQueue.defaultQueue.storefront.countryCode always returns "CHN" instead of the expected "USA".
2、This issue only occurs on iOS 18.2 and above.
3、On the same device running iOS 17.5.1, the behavior is correct. However, after upgrading the system to iOS 18.3.2, the error occurs.
4、In the sandbox environment, although SKStorefront.countryCode returns the wrong value, the currency type for Apple's in-app purchase is correct when initiating the payment.
5、The issue only exists in the sandbox environment and does not occur in the App Store-downloaded package.
Demo Code:
- (IBAction)clickButton:(id)sender
{
NSString *appStoreCountryCode3 = SKPaymentQueue.defaultQueue.storefront.countryCode;
NSLog(@"%@",appStoreCountryCode3);
}
Demo Testing Steps and Results:
1、Sandbox Account A (China) will print "CHN".
2、Go to Settings - Developer - (at the bottom) SANDBOX APPLE ACCOUNT, and switch to another sandbox account B (USA).
3、Restart the Demo App.
4、Print results:
iOS 17.5.1: "USA" ✅ → Upgrade the system of the same device to iOS 18.3.2 → "CHN" ❌
iOS 18.2.1: "CHN" ❌
iOS 18.3.1: "CHN" ❌
iOS 18.3.2: "CHN" ❌
Possible Clues:
Starting with iOS 18.2, Apple changed the entry point for setting up sandbox accounts, which introduced this bug. It seems that when users switch sandbox accounts on iOS 18.2, Apple engineers forgot to notify the SKStorefront class to update the countryCode value.
Before iOS 18.2: Settings - App Store - Sandbox Account
iOS 18.2 and later: Settings - Developer - (at the bottom) Sandbox Account
Although it doesn't affect the App Store package, it does impact our development and testing process. We hope this issue can be fixed in future versions. Thank you!
I'm receiving the following error when attempting to validate an in‑app purchase receipt:
Certificate verification failed at depth 0 : forge.pki.UnknownCertificateAuthority
Certificate chain validation failed: Certificate is not trusted.
This error occurs during the certificate chain validation process of the receipt's PKCS#7 container. My implementation uses node‑forge to decode the receipt, extract the embedded certificate chain, and verify that the chain properly links from the leaf certificate (which directly signed the receipt) through the intermediate certificate to the trusted Apple Inc. Root certificate.
What the Error Indicates:
"UnknownCertificateAuthority" at depth 0:
This suggests that the leaf certificate in the receipt is not being recognized as part of a valid chain because it cannot be linked back to a trusted root in my CA store.
"Certificate chain validation failed: Certificate is not trusted":
This means that the entire certificate chain does not chain up to a trusted certificate authority (in this case, the Apple Inc. Root certificate) as expected.
Steps Taken:
I verified that the receipt is a valid PKCS#7 container.
I extracted the certificate chain from the receipt. However, the receipt only provided the leaf certificate.
I manually added the intermediate certificate (AppleWWDRCAG5.pem) to complete the chain.
I loaded the official Apple Inc. Root certificate (AppleIncRootCertificate.pem) into my CA store.
Despite these steps, the validation still fails at depth 0, indicating that the leaf certificate is not recognized as being issued by a trusted authority.
Request for Assistance:
Could you please help clarify the following points:
Is the certificate chain for receipts (leaf → intermediate → Apple Inc. Root) as expected, or has there been any change in the chain that I should account for?
Is there a recommended or updated intermediate certificate I should be using for receipt validation?
Are there known issues or recent changes on Apple's side that might cause the leaf certificate to not be recognized as part of a valid chain?
Any guidance to resolve this certificate chain validation error would be greatly appreciated.
Hi everyone,
I’m struggling to get StoreKit 2 to fetch products in my SwiftUI app while using a sandbox user. I think I’ve followed all necessary setup steps in Xcode, App Store Connect, and my physical test device, but Product.products(for:) always returns an empty array. I’d appreciate any insights!
What I’ve Done
Local App Setup (Xcode 16.2)
Created a blank SwiftUI Xcode project.
Enabled In-App Purchase capability under Signing & Capabilities.
Implemented minimal StoreKit 2 code to fetch available products (see below).
Using the correct bundle identifier, which matches App Store Connect.
App Store Connect Configuration
Registered the app with the same bundle identifier.
Created an Auto-Renewable Subscription with:
Product ID: v1 (matches my code).
All fields filled (pricing, localization, etc.).
Status: Ready for Review.
Linked the subscription to the latest app version in App Store Connect.
Sandbox User & Testing Setup
Created a sandbox tester account.
Logged in with the sandbox user under Settings → Developer → Sandbox Apple ID. This was on my physical device (iOS 18.2).
Installed and ran the app directly from Xcode (⌘+R).
Issue: StoreKit Returns No Products
Product.products(for:) does not return any products.
There are no errors thrown, just an empty array.
I confirmed that StoreKit Configuration is set to None in Xcode.
No StoreKit-related logs appear in the Console.
Code Snippets
//StoreKitManager.swift
import StoreKit
import SwiftUI
@MainActor
class StoreKitManager: ObservableObject {
@Published var products: [Product] = []
@Published var errorMessage: String?
func fetchProducts() async {
do {
let productIDs: Set<String> = ["v1"] // Matches App Store Connect
let fetchedProducts = try await Product.products(for: productIDs)
print(fetchedProducts) // Debug output
DispatchQueue.main.async {
self.products = fetchedProducts
}
} catch {
DispatchQueue.main.async {
self.errorMessage = "Failed to fetch products: \(error.localizedDescription)"
}
}
}
}
//ContentView.swift
import SwiftUI
struct ContentView: View {
@StateObject private var storeKitManager = StoreKitManager()
var body: some View {
VStack {
if let errorMessage = storeKitManager.errorMessage {
Text(errorMessage).foregroundColor(.red)
} else if storeKitManager.products.isEmpty {
Text("No products available")
} else {
List(storeKitManager.products, id: \.id) { product in
VStack(alignment: .leading) {
Text(product.displayName).font(.headline)
Text(product.description).font(.subheadline)
Text("\(product.price.formatted(.currency(code: product.priceFormatStyle.currencyCode ?? "USD")))")
.bold()
}
}
}
Button("Fetch Products") {
Task {
await storeKitManager.fetchProducts()
}
}
}
.padding()
.onAppear {
Task {
await storeKitManager.fetchProducts()
}
}
}
}
#Preview {
ContentView()
}
Additional Information
iOS Version: 18.2
Xcode Version: 16.2
macOS Version: 15.3.1
Device: Physical iPhone (not simulator)
TestFlight Build: Not used (app is run directly from Xcode)
StoreKit Configuration: Set to None
Hello!
I'm working on implementing SwiftUI + StoreKit2 IAP in my app, and Xcode testing has been fantastic, now I'd like to test my app with Sandbox, where I created a Sandbox account, and it works on my physical device, I can log in, make transactions, etc. (btw, feedback: please improve the UX for Sandbox testing, it's really clumsy compared to Xcode testing with Transaction Manager)
My problem is that when I'd like to log in with my Sandbox account on the simulator (Settings -> Developer -> Sandbox Apple Account (at the bottom) -> Sign in), it doesn't work, it fails silently. I know it authenticates well, because if I type in the wrong password, I get an error popup, but with the right password, it just fails silently, hides the login sheet and the "Sign in" text remains "Sign in" (on my phone when I log in, the "Sign in" is replaced with the email address of the Sandbox account).
I know many people get errors, and they recommend to go icloud.com and acccept TOS (done that), also to download the latest iOS for the simulator (also done), these are not a problem for me, as I don't get any errors. My authentication works, but for some reason the simulator still won't log in, it fails silently, and I see no errors/reason why. Tried with different simulators (latest iOS version), same result, tried to reboot the simulator, same result.
Any idea why is this happening?
Thank you,
sendai
The application is developed with Xamarin Framework and it is live now.
The customer installed the app and purchased the annual subscription.
And for some reason, they uninstall and reinstall the application on the same device.
Now user wants to restore the subscription. In the application, there is an option to Restore the subscription. But restore API not return purchase details.
But when clicking the subscription button instead of restoring the subscription, it says you subscribed to this plan".
is there any possibility of not getting VerifyRecipt even after a successful purchase?
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
App Store
StoreKit Test
App Store Connect
I am currently using StoreKit2 to set up the in-app purchase subscription flow, and I have already configured the subscription products in App Connect. I created a StoreKit Configuration file in Xcode and used it in the scheme. However, after completing the purchase, the transaction.jsonRepresentation data returns a transactionId of 0. After checking the documentation, I found that I need to disable the StoreKit Configuration and enable Sandbox Testing. But after disabling the StoreKit Configuration, I can't retrieve the real product data using Product.products(for: productIds). I can confirm that the ProductId I provided is real and matches the data configured in App Connect. Could you please help me identify the issue? Thank you
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
Developer Tools
StoreKit Test
StoreKit
As you can see in the screenshot, the verification popups that appear when making a StoreKit purchase cut off the buttons. When typing the code into the input field, the window will also flicker and stutter with random view refreshes. Is this something I can configure/change? It's not a very pleasant experience for making an in app purchase.