StoreKit

RSS for tag

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

Posts under StoreKit tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

# In-App Purchases Not Available in Sandbox Testing Environment Despite Being Approved
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!
0
0
24
10h
Adding In-App Purchase to app + review required?
I'm trying to understand the IAP development process. I created my first Product on App Store Connect and am trying to build my app to use it. However it keeps failing with "Invalid product ID.". From what I've read, this is because the product has not yet gone through review. But what I don't understand is, of course it hasn't gone through review yet, because trying to use it in any capacity fails, even though I'm using a real physical device and using a Sandbox User. Is this the correct workflow? It seems very backwards that I have to submit the product for review, even before I know how it's going to be used. I'm still building the screen for the product page, and haven't even started touching any backend APIs, yet it's asking for screenshots. Am I misunderstanding something here?
0
0
12
18h
[Suggestion] Improving App Store Pricing Models
I would like to share some feedback regarding the current App Store pricing model, particularly around subscriptions. Over time, there has been a noticeable shift from one-time purchases to subscription-based pricing for nearly all types of apps and games. While subscriptions make sense for content-driven services such as streaming (movies, music, books, etc.), they often feel forced or excessive when applied to standalone apps or games that previously used a one-time purchase model. Many users view this as an abuse of the subscription system, leading to frustration and distrust. As a developer, I also understand the challenge of sustaining revenue, especially when major updates require significant time and resources. One-time purchases often don’t reflect the long-term value an app may provide or the cost of continued development. That said, I believe a more balanced approach would benefit everyone. I’d like to suggest the implementation of a major upgrade pricing model on the App Store. For example, when a developer releases a major new version of an app (e.g., 2.0, 3.0, etc.), they could offer: A standard price for new users (e.g., $2.99) A discounted upgrade price for existing users (e.g., $0.99) This would allow developers to be fairly compensated for continued innovation while also respecting customers who have already supported the app. Subscriptions could then be more appropriately reserved for content-based services. I believe this model would create a healthier ecosystem for both users and developers, encouraging more sustainable and transparent pricing practices. Feedback Assistant : FB17281833
0
0
26
3d
.storeButton(.visible, for: .policies) shows “Terms of Service Unavailable” — how does it work?
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!
0
0
20
3d
InvalidRequestError on iOS 18.4
We’ve recently encountered an increased rate of purchase errors StoreKit.InvalidRequestError error 1 (https://developer.apple.com/documentation/storekit/invalidrequesterror) specifically on iOS 18.4. We suspect this might be related to the new Advanced Commerce API introduced by Apple, although we haven’t made any changes related to this API in our app. Have you experienced similar issues since the release of iOS 18.4 or when integrating the Advanced Commerce API? Any insights or suggestions would be greatly appreciated. Thanks!
0
0
57
6d
App Store Guidelines: auto-renewable subscription offer code as non-consumable alternative?
Hi, My app currently offers a non-consumable in-app purchase to unlock all its features, and I would like to provide this full access for free to an organization with a few thousand Macs. Since Apple limits non-consumable in-app purchase promo codes to 1000 per app, this isn't sufficient for the organization's size. So I'm considering an alternative approach using an auto-renewable annual subscription with offer codes: Create a few thousand offer codes for an annual subscription. Users within the organization would redeem these codes. Instruct users to immediately unsubscribe after redeeming the code. The app would then check the in-app purchase receipt. If the receipt contains a transaction redeemed with an offer code, the app would treat this as a permanent unlock of all features. My concern is that repurposing an auto-renewable subscription in this manner—effectively turning it into a lifetime unlock triggered by redeeming an offer code and immediately cancelling—might violate App Store guidelines. Is using an annual subscription and offer codes this way likely to be compliant with App Store guidelines? Thank you for your guidance!
0
0
22
6d
Reporting to External Purchase Server API when using alternative PSP in the EU
Dear community, Context My company operates in the European Union, where not so long ago there appeared the possibility to accept an ["Alternative Terms Addendum for Apps in the EU"] (https://developer.apple.com/contact/request/download/alternate_eu_terms_addendum.pdf), which, among others, gives us the possibility to use an alternative payment provider, other than Apple's In App Purchase PSP system (ref: Apple docs). My company did accept it and was granted the StoreKit External Purchase Entitlement (com.apple.developer.storekit.external-purchase) entitlement, with which we integrated a different PSP, so now we want to incorporate the reporting to Apple's External Purchase Server API. We are currently integrating with the External Purchase Server API and have encountered a couple of issues I would appreciate clarification on: Question 1 Is there a way to retrieve an overview or summary of the current subscription states on Apple’s servers as a result of the submitted reports to External Purchase Server API? Specifically, I would like to verify the expected outcomes before the monthly invoice is issued by Apple and to understand the subscription states for the test users I used during this process and for future reference as well. Question 2 In one scenario, I initiated a one-year subscription, and in the middle of its period, I submitted a RENEWAL for one month with a higher price. I expected the request to fail due to overlapping periods and/or pricing conflicts, but both submissions were accepted without error. Do you have an idea about: What happens at the end of the renewed month? Will the subscription continue with the renewed (higher) amount, revert to the original (lower) annual rate, or be canceled? Where can I view the final state and billing plan for that subscription? Thank you for your assistance, we are looking forward for any kind of help or information regarding this topic.
0
0
38
1w
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
41
1w
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!
0
0
19
1w
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
46
1w
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
17
1w
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
28
2w
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
55
2w
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
21
2w
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.
3
0
48
2w
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
78
2w
“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
79
2w
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.1k
2w