Hi,
In an auto-renewable subscription scenario, I receive a transaction from Product.Purchase and then send the transaction ID (e.g., 500000000738201) to my API server. After receiving the response, I called transaction.finish().
The account has purchased the subscription before and expired. So it's re-subscribe.
And then, I received a RESUBSCRIBE notification from Apple’s server to my API server. I noticed a discrepancy where the transaction ID in the notification is decreased by one (e.g., 500000000738200 instead of 500000000738201).
I’m wondering why this discrepancy occurs and how it happens.
Best regards,
RoyHuang
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
FB19377002
I am looking to improve and review my subscription purchase handling logic, for the best user experience.
Considering that StoreKit2 caches local raw transactions (in case user is offline), is it really necessary to persist "unlocked status" in UserDefaults or SwiftData Model or AppStorage? Are there significant delays when reading Transaction.currentEntitlements from locally stored cache, versus reading it from UserDefaults; or, as in the latest SKDemo example, even reading it from stored in SwiftData ?
https://developer.apple.com/forums/thread/706450
I only have subscriptions ( I don't have noncosumable or consubale products). Do I still need to persist subscription status?
I cannot test IAP using sandbox account that I logged on from settings, it keeps show my regular Apple ID when I try to test IAP from TestFlight
This issue frustrate me and bunch of my colleagues, we cannot manage our subscription when sandbox account is default choosing Apple ID
I've seen people complaining about this issue a lot
Any help on resolving this issue would be really appreaciated
We’re testing SKAN postbacks via AdAttributionKit but aren’t receiving any requests on our server even after generating development impressions and triggering a postback.
Setup:
Domain: https://linkrunner-skan.com
Configured in Info.plist as:
<key>NSAdvertisingAttributionReportEndpoint</key>
<string>https://linkrunner-skan.com</string>
<key>AttributionCopyEndpoint</key>
<string>https://linkrunner-skan.com</string>
Apple automatically appends the .well-known paths:
/.well-known/private-click-measurement/report-attribution/
/.well-known/skadnetwork/report-attribution/
ATS diagnostics for the domain: PASS for all tests (TLS 1.0–1.3, PFS disabled, arbitrary loads allowed, etc.)
Both .well-known paths are publicly accessible and return 200 OK
Testing Flow:
Enabled Developer → AdAttributionKit Developer Mode on iOS (15+)
Followed Apple’s official guide: Testing AdAttributionKit with Developer Mode
Generated test impression using:
createAdAttributionKitDevelopmentImpression implemented in SKANManager.swift
Called Postback.updateConversionValue with lockPostback: true
Created Development Postback from Developer Settings
Waited 30+ minutes while intercepting server requests (proxy + backend logs)
What We’ve Tried So Far:
Confirmed ATS compliance with nscurl --ats-diagnostics (all PASS)
Verified .well-known paths are accessible publicly without redirects
Tested endpoints manually with a POST request – server responds 200 OK
Confirmed Info.plist entries exactly match Apple’s required keys
Double-checked iOS device is running iOS 15+ with Developer Mode enabled
Repeated test flow multiple times with fresh impressions and postbacks
Waited up to 1 hour for postback (in case of delays)
Issue:
No POST requests are being received from Apple to either .well-known endpoint, even though the setup appears correct and ATS tests pass.
References Used:
Configuring an Advertised App
Generating JWS Impressions
Question:
Has anyone faced a similar issue where AdAttributionKit Development Postbacks are not firing despite correct Info.plist setup, ATS compliance, and reachable .well-known endpoints?
Any insight into possible missing configuration steps or testing nuances would be greatly appreciated.
When simulating a Storekit error like an invalid device verification or others of that type, should we finish a failed transaction? When I test with a Storekit configuration file, all failed transactions persist after every restart. The Apple-provided sample code for Storekit 2 has transactions finished only when they are successful.
I have an auto-renewable subscription. I have two methods helping me keep track of when they are expired
@MainActor public func isPurchased(product: Product) async -> Bool {
guard let state = await product.currentEntitlement else {
return false
}
switch state {
case .unverified(_, _):
return false
case .verified(let transaction):
await transaction.finish()
return isTransactionRelevant(transaction)
}
}
private func isTransactionRelevant(_ transaction: Transaction) -> Bool {
if let revocationDate = transaction.revocationDate {
logger.error("Transaction verification failed: Transaction was revoked on \(revocationDate)")
return false
}
if let expirationDate = transaction.expirationDate,
expirationDate < Date()
{
logger.error("Transaction verification failed: Transaction expired on \(expirationDate)")
return false
}
if transaction.isUpgraded {
logger.error("Transaction verification failed: Transaction was upgraded")
return false
}
logger.info("Transaction verification succeeded")
return true
}
I also have this that I can call to get the latest state of purchases
@MainActor public func updateStoreKitSubscriptionStatus() async {
var currentProductsPurchased: [Product] = []
for await result in Transaction.currentEntitlements {
if case .verified(let transaction) = result {
if isTransactionRelevant(transaction) {
if let product = products.first(
where: { $0.id == transaction.productID
})
{
currentProductsPurchased.append(product)
}
}
await transaction.finish()
}
}
self.purchasedProducts = currentProductsPurchased
}
Right now when a subscription expires the user needs to manually do some action that triggers updateStoreKitSubscriptionStatus() as it appears that expirations do not come through in Transaction.updates.
I am surprised there does not seem to be a better way. Does StoreKit not notify you somewhere that an auto-renewable subscription has expired? Can you observe it in an ObservableObject? Or do I need to just frequently poll Transaction.currentEntitlements even if I dont expect frequent updates?
Topic:
App & System Services
SubTopic:
StoreKit
In all the illustrations of win-back offers, I see an example of "Get 3 months off, then $X/month", as seen below.
First, I'm not exactly clear how each configuration translates into an actual offer in practice:
If I want to offer 3 months off on an annual subscription, ie. only if the user pays for the annual offer (basically a 25% discount), is that possible?
If I set a "Free" type, of 3 months, I guess that would allow the user to cancel before paying for the annual, correct?
If I set a "Pay up front" type, with a 25% discount, how would that show up to the user on the App Store?
Secondly, is eligibility to an offer determined by the user elapsing on the same subscription or any subscription in the same subscription group?
Thank you
Over the past two days, we've observed an unusual spike in requests from some iOS users to our server endpoint responsible for verifying App Store purchase receipts.
After sampling and analyzing the data, we found that the cause is related to the behavior of StoreKit2.Transaction.updates. Specifically, when listening for transaction updates, the system returns a large number of historical transactions — some dating back as far as one year. These callbacks are interpreted as "new" transactions, which in turn trigger repeated calls to Apple’s receipt verification servers, leading to an abnormal surge in traffic and putting pressure on our backend services.
This behavior is ongoing and is something we've never encountered in our previous experience. It appears to be outside of expected behavior, and we suspect it may be due to some kind of abnormality or unintended usage scenario.
We would appreciate guidance on the following:
Is this a known behavior or issue with StoreKit2?
Are there specific device states or conditions that could cause the system to emit historical transactions in bulk?
Are there any recommended practices for mitigating or filtering such transaction floods?
We have attached logs for reference. Any help identifying the root cause or suggestions for investigation would be greatly appreciated.
2025-07-24 12:39:58.594 +0400 listenForTransactions :{
"appTransactionId" : "704289572311513293",
"environment" : "Production",
"inAppOwnershipType" : "PURCHASED",
"originalPurchaseDate" : 1713445834000,
"originalTransactionId" : "430001791317037",
"purchaseDate" : 1713445834000,
"quantity" : 1,
"signedDate" : 1753346396278,
"storefrontId" : "143481",
}
2025-07-24 12:39:58.594 +0400 listenForTransactions :{
"appTransactionId" : "704289572311513293",
"deviceVerificationNonce" : "c4f79de2-a027-4b34-b777-6851f83f7e64",
"environment" : "Production",
"inAppOwnershipType" : "PURCHASED",
"originalPurchaseDate" : 1713445849000,
"originalTransactionId" : "430001791317270",
"purchaseDate" : 1713445849000,
"quantity" : 1,
"signedDate" : 1753346396278,
"storefrontId" : "143481",
"transactionId" : "430001791317270",
}
2025-07-24 12:39:58.594 +0400 listenForTransactions :{
"appTransactionId" : "704289572311513293",
"deviceVerificationNonce" : "02f305d7-0b2d-4d55-b427-192e61b99024",
"environment" : "Production",
"inAppOwnershipType" : "PURCHASED",
"originalPurchaseDate" : 1713511999000,
"originalTransactionId" : "430001792218708",
"purchaseDate" : 1713511999000,
"quantity" : 1,
"signedDate" : 1753346396278,
"storefrontId" : "143481",
"transactionId" : "430001792218708",
}
2025-07-24 12:39:58.598 +0400 [INFO] [MKPaymentService:23]: [XLPay] listenForTransactions :{
"appTransactionId" : "704289572311513293",
"deviceVerificationNonce" : "5ca85907-1ab6-4160-828e-8ab6d3574d6f",
"environment" : "Production",
"inAppOwnershipType" : "PURCHASED",
"originalPurchaseDate" : 1713512034000,
"originalTransactionId" : "430001792219189",
"purchaseDate" : 1713512034000,
"quantity" : 1,
"signedDate" : 1753346396278,
"storefrontId" : "143481",
"transactionId" : "430001792219189",
}
2025-07-24 12:39:58.599 +0400 listenForTransactions :{
"appTransactionId" : "704289572311513293",
"deviceVerificationNonce" : "04869b50-b181-4b69-b4ff-025175e9cf14",
"environment" : "Production",
"inAppOwnershipType" : "PURCHASED",
"originalPurchaseDate" : 1713512049000,
"originalTransactionId" : "430001792219440",
"purchaseDate" : 1713512049000,
"quantity" : 1,
"signedDate" : 1753346396278,
"storefrontId" : "143481",
"transactionId" : "430001792219440",
}
Hello,
I am consistently receiving the error message "In-app purchases are not allowed on this device" whenever I try to make an in-app purchase on my iOS device. Despite following all the recommended solutions I could find online, the issue remains unresolved.
Here is a list of the steps I have already taken:
Checked Screen Time Settings:
I navigated to Settings > Screen Time > Content & Privacy Restrictions > iTunes & App Store Purchases.
I have confirmed that "In-App Purchases" is set to "Allow." I have also tried toggling this setting off and on again.
Signed Out & In of Apple ID:
I signed out of my Apple ID via Settings > [Your Name] > Media & Purchases, restarted the device, and then signed back in.
Restarted the Device:
I have force-restarted my device multiple times.
Updated iOS:
I have ensured my device is running the latest version of iOS (checked via Settings > General > Software Update).
Verified Payment Method:
I have confirmed that my payment method on file is valid and up-to-date.
Created a New Sandbox Account:
I also created a new Sandbox Tester account in App Store Connect and tested with it, but the result was the same.
Device Information:
Device Model: iPhone 15, iPhone 13
iOS Version: iOS 17.5, iOS 18
Even after performing all of these steps, the problem persists. Has anyone else encountered such a stubborn issue, or does anyone have a different solution I could try?
Thank you in advance for your help.
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit Test
StoreKit
In-App Purchase
Hello 👋! I'm trying to switch the business model in my app from premium to freemium, gracefully so that existing users aren't bothered. I'd like to provide newly-paywalled content for original paid users. For this to work, I need to use originalAppVersion in AppTransaction, and support iOS 16 at minimum. I've asked about originalAppVersion earlier here.
I've upped to iOS 16 already, but I don't exactly know how to call AppTransaction.shared to get originalAppVersion. The issue lies in the fact that my app is based on SpriteKit, so the operative areas I have available to call AppTransaction are ostensibly limited to AppDelegate and GameViewController.
I'm using the code from Supporting business model changes by using the app transaction, but if I place it in either GameViewController or AppDelegate, for example in application(_:didFinishLaunchingWithOptions:) or viewDidLoad(), I get an error concerning async/await. Now, I understand the gist of it: these are not asynchronous methods. So I'm trying to understand how to do it perhaps outside of these methods.
How do I call AppTransaction.shared (and fetch originalAppVersion) in a SpriteKit based app?
Topic:
App & System Services
SubTopic:
StoreKit
Greetings!
I was reviewing the documentation for the Apple Store Server Notification v1 APIs and saw the deprecation notice. We are currently unable to migrate to v2 in the near future. With that in mind, I want to know if there were any plans to shut off v1, and if so, was there any timeline we could expect? Thank you in advance.
Reference: https://developer.apple.com/documentation/appstoreservernotifications/app-store-server-notifications-version-1
My app has in app purchase for subscriptions, available in many countries. When using Sandbox App Store accounts on TestFlight with a locale different from my own in the iOS 26 RC, I'm getting incorrect currency coming back from Product.products(for: identifiers), and so my app displays the wrong price for the locale. However, the actual Apple Pay buy sheet shows the proper currency symbol and currency amount. This did not happen on prior versions of iOS.
Is anyone else experiencing this?
Hi,
I am trying to obtain the subscription expiry date or purchase date from server using Storekit2 for my project.
I have an account which is already having an active subscription but it still says no purchase found.
Thanks
I'm encountering an issue with the App Store Server API where the appAccountToken is not preserved when users migrate their Apple ID email addresses. I've submitted
Feedback Assistant ticket FB18709241 but wanted to check if anyone else has experienced this and get community input on best practices.
The Issue
When a user migrates their Apple ID from one email to another (e.g., from olduser@example.com to newuser@icloud.com), the App Store creates a new subscription
transaction with a different originalTransactionId, but the appAccountToken is not carried forward from the original transaction.
What I'm Seeing
note: these values are fake
When querying /inApps/v1/subscriptions/{originalTransactionId} with the either post-migration transaction ID or the pre-migration transaction ID, the API returns both transactions:
Pre-migration transaction (status: 2 - inactive):
originalTransactionId: "12345678910111"
Contains: "appAccountToken": "abc123-def456-ghi789"
Post-migration transaction (status: 1 - active):
originalTransactionId: "67891011121314"
Missing: appAccountToken entirely
The Problem
The appAccountToken is our only way to link App Store subscriptions to user accounts. Without it on the new transaction:
Users lose access to premium features despite having valid subscriptions
Server-side renewal notifications can't be matched to user accounts
Manual support intervention is required for each affected user
Questions for the Community
Has anyone else encountered this issue with Apple ID migrations?
What's the recommended approach for handling this scenario?
Is there an alternative mechanism to maintain the subscription-to-user linkage across migrations?
Questions for Apple Engineers
Is this the expected behavior, or should the appAccountToken be preserved?
Are there any planned improvements to handle this migration scenario?
What's the best practice for developers to handle this case?
Interestingly, both the old and new transaction IDs return the same JSON response from the App Store Server API, suggesting Apple maintains internal linkage between
these transactions, but the appAccountToken isn't carried forward to the active transaction.
Any insights or similar experiences would be greatly appreciated!
Thank you!!
Feedback Assistant: FB18709241
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
StoreKit
App Store Server Notifications
App Store Server API
Currently, I have an app running locally on my computer, and there is also a web app. To create an account, users need to pay through the web app, which handles the payment process smoothly. My question is: Do I need to implement In-App Purchases (IAP) if the payment is only for account creation?
Let me elaborate on my question. I know the typical answer is yes, but what if users in the mobile app cannot create an account or pay within the app itself? Instead, account creation is only possible via the web app, and only users who have paid outside the mobile platform can access and join the mobile app. This approach is similar to what Netflix and Spotify do – they do not allow account creation inside their mobile apps and do not provide any redirects or buttons indicating alternative payment methods (they do not have IAP).
I had a two CS from customers that they couldn't buy a cookies(IAP). they got an alert "Purchases in this app are already purchased items."
I was wondering if anyone has any similar experiences.
Topic:
App & System Services
SubTopic:
StoreKit
So, we've implemented IAP with StoreKit2 e2e for both the client and backend and it's working mostly perfectly, however we have an issue which we can't seem to understand Apple's behavior.
So, imagine a purchase that occurred on the 10th of December in the sandbox environment through an install from TestFlight, and this same purchase keeps getting queued in the Transaction.unfinished list for some reason (today, the 17th of December, a whole week after the initial purchase!).
Here's the flow:
We iterate the list on app launch
Send the unfinishedTransaction's transactionId to our servers
The server says "hey, we could verify it with Apple but it's not longer active (expired). We can't really work with it so just finish it on your side and don't send it to me again"
The client finishes!! the transaction
On the very next app launch it keeps reappearing in the Transaction.unfinished queue
Are we doing something wrong, why doesn't it get cleaned? Is this an expected behavior?
Note, this is generally the server's logic for new purchases:
If we weren't able to contact Apple - we tell the client to not finish the transaction so that we'll be able to re-iterate it on the next app launch or retry
If the transaction is not expired and valid - we update our records and tell the client to finish the transaction
If we couldn't update our records - we tell the client to not finish the transaction so that we'll be able to re-iterate it on the next app launch or retry
If the transaction is not valid for some reason - we tell the user to finish the transaction
The server might see it as a valid transaction if we'll send the originalTransactionId instead of the 'transactionId(using it to callgetTransactionInfoinAppStoreServerLibrary`), but is this something we want to do?
This will obviously not fix the problem because the server tells the client to finish the transaction anyways, but it simply doesn't work.
Please, any advice or changes to make to either Client/Server would be greatly appreciated
Best Regards, Ofek
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit
App Store Connect
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, all!
I have an AppStore Server-side question. User sends up an AppReceipt that I am validating. What's the best way to tell the receipt belongs to said user? I want to make sure that the source of the AppReceipt was actually the original purchaser of the item. Is fetching Transaction + AppAccountToken the only way? AppAccountToken can only be utilized if the original purchase used it, and it is associated with the user's data. Is there another way?
Hey everyone,
We're looking for the best way to handle App Store Server Notifications in our development setup and would appreciate some guidance.
Our Setup:
We use a single App Store Connect account for development, which supports multiple environments (e.g., staging1, staging2). Our production app lives in a separate account, so that's not an issue.
The Challenge:
We have only one configurable sandbox notification URL. This makes it difficult to route notifications to the correct development server (staging1 vs. staging2 vs developments) when a sandbox event occurs.
We're considering using a proxy server to catch all notifications and then forward them to the appropriate environment. However, we're not sure how to determine the correct destination.
Our Questions:
What's the recommended approach for managing a single sandbox notification URL across multiple development environments?
If a proxy is the best method, which parameter in the responseBodyV2 payload should we use to route the notification? How can we differentiate between our various dev environments?
Is it possible to add custom properties to the App Store Server Notification V2 body to facilitate routing?
Any advice or best practices you've implemented would be greatly appreciated.