Cannot retrieve products for iap or subscription on simulator iPhone 16 and real device iPhone XR also.
lutter: IAPError(code: storekit2_products_error, source: app_store, message: The operation couldn’t be completed. (NSURLErrorDomain error -1009.), details: The operation couldn’t be completed. (NSURLErrorDomain error -1009.))
flutter: Error fetching IAP products: IAPError(code: storekit2_products_error, source: app_store, message: The operation couldn’t be completed. (NSURLErrorDomain error -1009.), details: The operation couldn’t be completed. (NSURLErrorDomain error -1009.))
StoreKit
RSS for tagSupport in-app purchases and interactions with the App Store using StoreKit.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm currently working on transitioning to StoreKit 2. In order to see if my users are legacy users who purchased the app before I implemented an in-app purchase, I am trying to use the original purchase date for the app. Unfortunately, it's returning 0 seconds since 1970.
func updateOriginalPurchaseStatus() async throws {
let transaction = try await checkVerified(AppTransaction.shared)
self.originalPurchaseVersion = transaction.originalAppVersion
self.originalPurchaseDate = transaction.originalPurchaseDate
}
This is from the transaction:
[3] = {
key = "originalPurchaseDate"
value = number (number = 0)
}
Currently trying to figure out when I actually purchased the app, but it might be as early as 2012. And I likely used a download code.
Stripe offers variable payment structures, also known as "irregular recurring payments," which include:
Usage-based billing: Charges amounts based on usage during the billing cycle (e.g., minutes used or energy consumed).
Quantity-based billing: Charges a pre-agreed amount based on quantity (e.g., number of users in a subscription).
Is it possible to implement this type of billing in the Apple Store for apps? How would variations in amounts be handled?
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
App Store Connect
In-App Purchase
App Store Receipts
Looking for assistance in managing subscription upgrades for TestFlight users.
I have a few monthly subscriptions, 30days, each with a different set of available features, 1 with all, and 1 with fewer. (All are in proper order and grouped in App Store connection subscriptions)
subscribing seems to be working fine, and purchasing an upgrade is going ok.
what is not: reflecting the upgraded plan in app (currently reflects it will start in 30days when current subscription expires)
I’m lead to believe this will be resolved with a live app in App Store, that will then handle prorating, terminate the old plan and immediately start the new one.
looking for help getting TestFlight to show immediate upgrades.
I have implemented IAP. The purchases are successful. The refresh receipt is working fine, which then calls the requestDidFinish(_ request: SKRequest) delegate. I'm fetching the receipt url through 'Bundle.main.appStoreReceiptURL'. When I convert the receipt data in base64 string and send it to app store's sandbox api and try to validate the receipt, it fails giving status code : 21002.
We have a user that has an active subscription according to the appstore in our product but it is registering as expired. Hitting the subscribe button in the SwiftUI SK2 dialog does nothing, meaning, nothing happens.
Any ideas?
Topic:
App & System Services
SubTopic:
StoreKit
Currently, over the xcode environment to do the testing of product subscriptions through appstore are working correctly using the storeKit.
When deployed in testflight to do the testing over the integration environment, the store response times are being excessively high, in excess of 20 minutes.
This behavior is not replicated on Xcode, and is happening on recent versions uploaded to testflight, as earlier versions that were already tested and are currently in production.
In addition the communication between the appstore webhook and the BE is also failing in this environment.
It is being blocked to generate any test to be able to launch to production.
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
Developer Tools
App Store
StoreKit
Hey guys, I am developing a habit tracker app right now. I know it's basic but it's my first app and I wanted an easy start but this is more of a struggle than I thought. So I am trying to publish my app fully on the App Store however everytime I do there is some kind of bug with it. But when I test it, it works perfect for me. Anyways, in this case the reviewer said when they go to the pro page of my app to purchase a pro subscription and try to press upgrade to pro nothing pops up. It pops up normally for me on my iPhone but not other devices. I wanted to make sure if this was normal or if there is something I am supposed to fix. Any help is appreciated. Thank you.
Hi Apple Developer Team,
I'm looking to confirm some technical details regarding the pre-order flow and App Store receipt handling. Specifically, I have the following questions:
Q1: After a user installs an app via pre-order and launches it for the first time, will a valid App Store receipt be available immediately via [[NSBundle mainBundle] appStoreReceiptURL]? Are there any known cases where the receipt might be missing or invalid, requiring a manual refresh (e.g., via SKReceiptRefreshRequest)?
Q2: Is the pre-order flow currently supported in the sandbox environment? Specifically, is it possible to simulate pre-ordering an app and installing it in a sandbox or TestFlight environment, in order to test receipt generation and related logic?
https://developer.apple.com/documentation/appstorereceipts/responsebody/receipt
Q3: The receipt field in the App Store receipt structure is marked as deprecated. Is it still acceptable to use this field for validating receipts? Has Apple announced any timeline or system version in which this field will be fully removed or unsupported?
While testing an inapp purchase, if you purchase the same product twice from an account that does not have testflight permissions for the project and only has sandbox permissions, the second payment will receive the same transactionId as the first.
Why is that so? I know transactionID is unique.
Hi Friends,
I have an iOS app, which uses around 500 in app purchases for various modules. I am using StoreKit for in app purchase, now trying to migrate this to StoreKit 2.
I am using Product.products(for:) method to fetch all the products by sending identifiers of all the 500 In app purchases.
In response, I am getting details of only 160 products, the method is not returning remaining in app purchases.
What could be the reason for this behaviour, how to get rid of the issue?
May be is this the issue will happen only on TestFlight? If someone from Apple assures about it, we have plan to submit the app.
Please advise, Thank you.
Topic:
App & System Services
SubTopic:
StoreKit
Issue Description
I am experiencing persistent 401 Unauthorized errors when attempting to access the App Store Server API using JWT authentication. Despite following Apple's documentation and regenerating keys, I am unable to successfully authenticate.
Implementation Details
I'm implementing JWT authentication for the App Store Server API to retrieve transaction information from the following endpoint:
https://api.storekit.itunes.apple.com/inApps/v1/transactions/{transactionID}
My JWT generation code (in PHP/Laravel) follows Apple's documentation:
php$kid = '6W6H649LJ4';
$header = [
"alg" => "ES256",
"kid" => $kid,
"typ" => "JWT"
];
$iss = 'b8d99de7-b43b-4cbb-aada-546ec784e249'; // App Store Connect API Key Issuer ID
$bid = 'com.gitiho.learnCourse'; // Bundle ID
$payload = [
"iss" => $iss,
"iat" => time(),
"exp" => time() + 3600,
"aud" => "appstoreconnect-v1",
"bid" => $bid
];
$pathFileAuthKeyP8 = "AuthKey_6W6H649LJ4.p8";
$contentFileAuthKey = \File::get(base_path($pathFileAuthKeyP8));
$alg = "ES256";
$jwt = \Firebase\JWT\JWT::encode($payload, $contentFileAuthKey, $alg, null, $header);
Steps Taken to Troubleshoot
Verified that the Issuer ID is correct and in UUID format
Confirmed that the Key ID matches the private key filename
Regenerated the key with proper App Store Server API permissions
Ensured the private key file is properly formatted with correct headers and footers
Verified that the JWT is being properly encoded using the ES256 algorithm
Confirmed the bundle ID is correct for our application
Checked that the API endpoint URL is correct
Additional Information
This implementation previously worked correctly
We started experiencing 401 errors recently without changing our implementation
We are using the Firebase JWT library for PHP to encode the JWT
Request
Could you please help identify what might be causing these authentication failures? Is there any recent change in the authentication requirements or endpoint URLs that might be affecting our integration?
Thanks for support me.
FB19376771
Transactions monitoring. If I only have subscriptions, do I really need to "bother" with any sort of monitorTransactions() or just rely on subscription status (subscribed, revoked, cancelled ...) ?
This is in line with Apple SKDemo and recommendation:
// Only handle consumables and non consumables here. Check the subscription status each time
// before unlocking a premium subscription feature.
switch transaction.productType {
ref: [https://developer.apple.com/documentation/storekit/implementing-a-store-in-your-app-using-the-storekit-api)
The "Only handle consumables and non consumables here" recommendation by Apple in ref to the process transaction code above is nuanced and confusing if we know what was with other external experts recommendation saying when using only SK2 Views :
"This is where most developers trip up in trying to get an experience that App Review is happy" ...
continuing :
"Be careful: that Purchase View code alone isn’t enough, because one of the possible completion status is .pending: the purchase is in the process of happening but hasn’t completed yet, so you still need to watch the transaction queue manually to be absolutely sure of handling the process completely."
Does this holds true for the new SubscriptionStoreView ?
We are not sure with quite obscure Apple documentation what SubscriptionStoreView handles, other than purchase (and now subscribe) function, and we do not know what diverse type of error handling messages it can return. Moreover, Apple documents: "Only handle consumables and non consumables here" ?
@Apple can you please share more insights on Purchase button on SubscriptionStoreView e.g
A) does it close ( finish). the purchase transaction ?
B) What error results can it return ?
C) What .onInAppPurchaseCompletion can handle as result ?
I set both production and sandbox App Store Notification server.
In sandbox, my server can receive all kinds of app store notification, including subscription and non-consumable in-app-purchase.
But in production, my server only receive subscription notification.
I can see some non-consumable in-app-purchase done in log, but the server didn't receive expected notification.
Anyone know why?
I really need the notification cause I need to know who made refund.
After I configured a consumable subscription(In App Purchases) on the apple platform, when I change the price in the App's server, is there any existing apple Api support to change the price on the apple platform? Of course, I know I need to resubmit.
Hi everyone,
I am working on a Unity iOS app. I am adding in-app purchasing in my app. I have added Unity IAP to the Unity project, as well as the code for initialising and purchasing a subscription with the product ID. I have also added my certificates and provisioning profile in Xcode with in-app purchasing capabilities. Also, I have set up an App Store Connect page with a non-renewing subscription with a unique product ID and all required information. The subscription status is ready to submit. I have added a sandbox tester account in it. In unity editor, it is working fine with fake purchase receipt.
While testing in an iOS device, apple ID is logged out. But there is an error occurs everytime : IAP not initialized.
Also I have uploaded a newer version of app on app store connect, it is in waiting for review status.
Is there any step or something I am missing that it is not working in iOS device?
Please help
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
App Store Connect
In-App Purchase
Apple Unity Plug-Ins
I am using StoreKit 2 for my products and noticed that users from Ukraine (for example) receive a wrong Product.displayPrice.
The App Store works with USD but shows the local currency UAH.
Any chance to display the correct currency (USD)?
Topic:
App & System Services
SubTopic:
StoreKit
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?
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
StoreKit
App Store Server Notifications
App Store Receipts
Product.SubscriptionInfo.isEligibleForIntroOffer(for: "21340582")
In the production environment, I have already used the intro offer for this group, but this method still returns true
Hi, I've some issues on my application about purchases.
My app is available for iOS and tvOS.
Some part of my code is the same on both target (my purchase code is one of them).
The issue is:
Some users can't do a purchase on Apple TV (but not all and I can't reproduce)
Some users purchased on a device and are not considered as pro on the other device (logged with same apple account). Again it's not all.
Here is my store code