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!
StoreKit
RSS for tagSupport in-app purchases and interactions with the App Store using StoreKit.
Posts under StoreKit tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Originally I thought this was shown by the OS after finishTransaction was called but it seems to be happening earlier, like when the transaction status changes to SKPaymentTransactionStatePurchased correct?
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
We sell magazines through a third party app platform called Pocketmags and our website. The magazines have Print, Digital and Combo options available for purchase. Also, this third party app provides the platform to read the digital version of the magazines.
Once a user buys a subscription on the website, he/she receives the email with the login information on PocketMags, where he registers his login details and can start reading his subscription. With us, the customer shares his billing/shipping address along with their email id while they make payment.
Now we have our own app where through which we want to sell these magazines and have to integrate In-App purchase for selling these digital subscriptions. How do we send the 3rd party subscription access details on email to the user if they do in app purchase?
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 just converted my App to Freemium, but the method is used to give user, that bought the App before it was free, access to the paid futures seems not to be working.
I am getting the original Purchase Date from the AppTransaction (https://developer.apple.com/documentation/storekit/apptransaction/originalpurchasedate) and comparing that to a set date where the App Model changed. In Test Flight this is working without any Problems but on the Live System, users that have purchased the App do not get access!
let shared = try await AppTransaction.refresh()
if case .verified(let appTransaction) = shared {
result(appTransaction.originalPurchaseDate.ISO8601Format()).
}
I am using flutter to develop the App and the result()... send the string back to the flutter side.
Here is the code of the Flutter side:
Future<void> restorePurchases() async {
SubscriptionProvider().updatePayment(PurchaseStatus.pending);
await InAppPurchase.instance.restorePurchases();
if (Platform.isIOS) {
DateTime changedToFreemium = DateTime.utc(2025, 4, 7, 11, 0, 0);
String? purchaseDateRaw = await IosFlutterChannel().getOriginalPurchaseDate();
if (kDebugMode) {
print("Purchase Date Raw: $purchaseDateRaw");
}
if (purchaseDateRaw != null) {
DateTime purchaseDate = DateTime.parse(purchaseDateRaw);
if (purchaseDate.isBefore(changedToFreemium)) {
if (kDebugMode) {
print("Restoring legacy purchases");
}
SubscriptionProvider().update(true, SubscriptionStatus.active, SubscriptionType.fs_lifetime);
} else {
if (kDebugMode) {
print("Not restoring legacy purchases");
}
}
}
}
SubscriptionProvider().updatePayment(PurchaseStatus.purchased);
}
Console Log when running in Test Environment:
flutter: Purchase Date Raw: 2013-08-01T07:00:00Z
flutter: Restoring legacy purchases
Thanks!
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
We are an EU-based company and targeting only the EU market. According to the EU regulations, we should be able to use alternative payment systems.
We decided to use Stripe SDK, as we already using Stripe on our web platform. However, when we sent the app for review, the reviewer asked us to add in-app purchases as a must in the app.
We have the Alternative Terms Addendum for Apps Distributed in the European Union signed, but it seem it is igored by the reviewer.
One more point, we would like to keep the payment process inside de app using Stripe SDK and not to send users out of the app via com.apple.developer.storekit.external-purchase, which is very wrong user experience.
Anyway we can't find any clear documentation how to enrole and use the alternative payment options in the app.
Please help.
New subscriptions have been failing to renew in the sandbox for 3 days. I am seeing multiple posts and comments from people that appear to be experiencing the same issue. But I haven't seen any feedback from Apple representatives.
I really do not want to launch a new app without seeing functioning renewals in the sandbox.
Is there somewhere else we are intended to seek assistance?
Yesterday I noticed that if I purchase a free trial subscription in my app using a sandbox account, when the subscription expires I see a “Billing Problem” message every time I open the app.
”allow purchases & renewals“ setting is ON so this shouldn’t happen.
has anyone else seen this or knows how to resolve?
observed on iOS 18.3.2 & 16.7.10
thanks
Hello, I'm currently experiencing issues with IAP subscription setup.
The following error appears:
"Billing Problem, There was a problem with your subscription renewal. To resolve, turn on Allow Purchases & Renewals, or leave off to test failed in-app purchase attempts and subscription renewals."
I'm testing with a sandbox account, and automatic subscription renewal is turned on in the sandbox settings.
A notification screen appears at the OS level, and consequently, a DID_FAIL_TO_RENEW error occurs on our payment server.
I cannot determine the cause at all, so I would appreciate your assistance in checking this issue.
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.
I'm having issues with StoreKit 2 when trying to load my auto-renewable subscriptions on a physical device via TestFlight. It works perfectly in the simulator using a local .storekit configuration file, but when I install the app through TestFlight, StoreKit does not return any products at all. Instead, I get the error:
"Storefront not available"
What I've Tried:
✅ In-App Purchases are enabled on my device.
✅ Using a sandbox account (confirmed logged in under Settings > Developer > Sandbox Account).
✅ The app is signed correctly with automatic signing in Xcode.
✅ The product IDs are correct (they work in the simulator with the local StoreKit file).
✅ I enabled SK2DebugLogging, but I don't see detailed errors.
✅ Restarted the device and signed out/in of my sandbox account.
✅ Checked that the App Store region matches my sandbox account’s region.
✅ The app is not fetching products dynamically at all on a real device—just getting "storefront not available."
Additional Notes
The app is installed via TestFlight, not running in debug mode from Xcode.
The app is signed in to the App Store with a real Apple ID (not the sandbox one).
Apple confirmed that products don’t need to be "Ready for Sale" for sandbox testing.
I checked the Console.app logs on my Mac, but nothing obvious showed up.
What I Need Help With
Why would StoreKit 2 fail to return products in TestFlight, but work fine in the simulator?
What does "storefront not available" actually mean in this context?
Any steps I might have missed to force StoreKit to fetch products properly?
Any help would be greatly appreciated! 🚀
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Swift
App Store Connect
StoreKit
When creating a subscription charging system for an iOS app, I am trying to change the display to yen, dollars, or euros depending on the user's country.
I am using [priceLocale] of [SKProduct] in [StoreKit] to obtain currency information linked to the Apple account from the App Store and change the display.
The smartphone I am testing on uses an Apple account created in Japan, and the nationality of the App Store is also set to Japan, so I expect the display to be in yen.
As a result, the TestFligh version displayed dollars, but the official release version displayed yen.
Why doesn't the TestFligh version display yen?
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 noticed a very weird behavior for refunds. When a user refunds an up-front paid app, they still have access to the app. How can I detect such a case and block access to the app?
In general, I think it should be handled by Apple, but for some reason, they don't do it.
I just spent way too many hours trying to figure out why my in-app subscription was stuck in “Missing Metadata” in App Store Connect, even though I had filled out everything. If you're here because you're in the same boat, this is the solution Apple doesn't make obvious.
The Problem
I created an auto-renewable subscription (Kanabloom Premium) and filled in all required fields.
The subscription was still marked "Missing Metadata", preventing me from submitting it.
The “In-App Purchases” section wasn’t showing up in my App Store version submission, which meant I couldn't even attach the subscription to my app version.
I triple-checked the metadata, pricing, tax settings, review screenshot, and even resaved everything, but nothing worked.
What I Tried (Before Finding the Fix)
Checked that pricing was set up correctly for all countries.
Uploaded the required review screenshot for the subscription.
Made sure the subscription group existed and was linked properly.
Refreshed, logged out/in, and tried different browsers.
Read every Stack Overflow, Reddit, and Apple Developer Forum post I could find.
Even tried creating a dummy subscription to see if that would reset the system.
The Solution: Localizing the Subscription Group
Here’s the stupidly hidden requirement that finally fixed it:
✅ Your subscription group itself (not just the subscription) needs a localized display name.
App Store Connect requires each subscription group to have at least one localized display name for it to be valid. If this is missing, all subscriptions inside that group will stay stuck in “Missing Metadata” no matter how complete they are.
How to Fix It:
Go to App Store Connect > Subscriptions > Subscription Group
Click on your subscription group (not the individual subscription).
Check if there's a localization added under "Group Reference Name."
If missing, add a localization (e.g., English) and save.
Refresh the page and boom – the subscription will finally be "Ready to Submit."
Conclusion
Apple really needs to make this requirement clearer. Now that I’ve finally figured it out, hopefully, this post helps someone else avoid losing hours of their life to the same issue.
If you're still stuck, double-check that:
You’ve set pricing and enabled "Cleared for Sale."
You’ve uploaded a review screenshot for the subscription.
You’ve signed all App Store agreements and banking/tax documents.
Your app's In-App Purchase capability is enabled in Xcode.
Let me know if this helped you! I wish I had found a post like this sooner. 😂
This should make for a useful and searchable post in case other devs run into the same headache. Let me know if you want any tweaks before posting! 🚀
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
App Review
StoreKit
We are currently performing maintenance and operation on our app.
I would like to ask a question about Apple's purchase processing.
When retrieving purchase information for a user who has multiple original transaction IDs, such as original transaction ID AAA and original transaction ID BBB, if "Get All Subscription Statues" is executed with BBB as an argument, is it possible that purchase information for original transaction ID "AAA" will be retrieved?
If this kind of issue does occur, please share the conditions under which it occurs.
I am an app developer, and I have implemented in-app purchases in my application. When a user completes a purchase, Apple displays a success popup. After the user taps "OK", I send the receiptData to my server to add points to their account.
However, I have encountered cases where users either exit the app before tapping "OK" or experience network issues, preventing the receipt from being sent to my server. As a result, they do not receive their points.
Later, some users send me a receipt from Apple Pay, claiming that the payment was successful. These receipts include details such as the orderId, email, and other transaction information. However, I am not certain whether the user actually completed the payment but encountered an issue, or if they are providing a fraudulent receipt.
My question:
How can I verify the authenticity of these receipts? Is there an official way to check if a given Apple Pay invoice corresponds to a real in-app purchase in my app?
Any guidance or best practices would be greatly appreciated!
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.