StoreKit

RSS for tag

Support in-app purchases and interactions with the App Store using StoreKit.

Posts under StoreKit tag

180 Posts

Post

Replies

Boosts

Views

Activity

Auto-renewable subscriptions does not work in production
I don't know why the subscription doesn't work in production, the message Subscription Unavailable appears. The subscription is approved in appstoreconnect. Works normally using storekit in xcode, both signing and using subscriber features. According to apple's guidance, first I do the test to validate https://buy.itunes.apple.com/verifyReceipt and then https://sandbox.itunes.apple.com/verifyReceipt. Plus I create the app-specific shared secret and put it in the code to validate the receipts. I have looked for several topics and I can not solve this problem. What do I need to do to make it work in production? I believe I did what's in the official documentation.
6
0
130
Apr ’25
Postback copies dev testing with AdAttributionKit
Hello, Having bad times with Development Postback copies receival on our custom server. Current setup: App is configured to be advertised (https://developer.apple.com/documentation/adattributionkit/configuring-an-advertised-app) AdAttributionKit - Opt in for Reengagement Postback Copies ✅ AdAttributionKit - Postback Copy URL ✅ AdAttributionKit - Ad Network Identifiers ✅ Configured backend https://{name}.com/.well-known/appattribution/report-attribution/ (POST) ✅ Devices with iOS 18.4 (with Postaback Development tool and AdAttribution developer mode Enabled) Tried different Postback setup combinations, with different app builds (debug, release installed from xcode/testflight) and with AdAttribution developer mode Enabled/Disabled - doesn't make any difference. Console log: Found 0 postbacks eligible for transmission for environments: Any advise is very much appreciated
1
0
106
Apr ’25
How to Simulate Subscription Cancellation with Products.storekit in Simulator?
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!
1
1
58
Apr ’25
In-App Subscription Rejected – “Transaction ID Not Found” during Review – Need Clarification
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...”
1
0
69
Apr ’25
Can I ask user to share his/her email id while doing
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?
0
0
43
Apr ’25
Problems using sandbox to test in app purchases
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.
0
0
70
Apr ’25
Converting Payed App to Freemium
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!
1
0
91
Apr ’25
Stripe SDK as payment option for EU company
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.
4
0
112
Apr ’25
Problems when testing Storekit purchases and subscriptions in Xcode and TestFlight
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.
0
0
64
Apr ’25
StoreKit 2 - "Storefront Not Available" on TestFlight (Works on Simulator)
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 &gt; Developer &gt; 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! 🚀
1
0
95
Apr ’25
Billing Problem while subscription renewal.
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.
20
15
1.2k
Apr ’25
“Billing problem” after free trial subscription expiry in sandbox environment
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 &amp; 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 &amp; 16.7.10 thanks
2
1
119
Apr ’25
The currency information obtained from [priceLocale] differs between the TestFlight version and the official release version.
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?
2
0
104
Apr ’25
Acknowledgment there is a subscription renewal problem?
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?
2
1
106
Apr ’25
original_transaction_id associated to web_order_line_item_id of auto-renewable subscription changed
Our app offers auto-renewable subscriptions using StoreKit Original API for In-App Purchase and App Store Server Notifications V1. Starting around 2025-03-15, we found some cases where original_transaction_id which was associated to web_order_line_item_id of already purchased subscription had changed in the receipt information of verifyReceipt response or App Store Server Notifications V1. The detailed steps are: Around February 2025, re-purchase from the app the same subscription product which was canceled and expired some time ago, using StoreKit Original API for In-App Purchase Receive the following 2 notifications from App Store Server Notifications V1 almost at the same time INITIAL_BUY DID_CHANGE_RENEWAL_STATUS In both notifications, latest_receipt_info contains the receipt for the re-purchased subscription period with new original_transaction_id and web_order_line_item_id pending_renewal_info contains both new original_transaction_id and original one which was generated at first purchase, and original one has "is_in_billing_retry_period": "1" Starting around 2025-03-15, the following happens When we receive another "DID_CHANGE_RENEWAL_STATUS" notification from App Store Server Notifications V1, original_transaction_id which is associated to web_order_line_item_id of the re-purchased subscription period has changed back to the original one (the one which was generated at first purchase) in latest_receipt_info. When we call verifyReceipt with the receipt obtained from appStoreReceiptURL, the response does not seem to contain new original_transaction_id which was generated at re-purchase We have some questions regarding this original_transaction_id behavior. When a user re-purchase the same subscription product which was canceled and expired some time ago, it seems that new original_transaction_id is generated. Is this an expected behavior? If yes, it seems that, at some point, original_transaction_id which is associated to web_order_line_item_id of the re-purchased subscription changed back to the original original_transaction_id which had been generated at first purchase. Is this an expected behavior? What triggers the original_transaction_id change to the original one? Is it related to some user actions or subscription status change?
3
0
309
Mar ’25
Unknown Error Occurring During Sandbox Purchase Testing
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?
0
2
181
Mar ’25
How to Verify the Authenticity of an In-App Purchase Receipt from Apple Pay?
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!
2
0
84
Mar ’25