How can I get the region region currently used in the macOS App Store? Preferably via Swift libraries, but any command / function will suffice.
The following StoreKit property seems to always return the region for the Apple Account associated with my macOS user.
await Storefront.current?.countryCode
See the Apple docs.
My macOS Apple Account region is US; in the App Store, when I sign into a different Apple Account whose region is GB (UK), Storefront.current?.countryCode continues to return US, not GB (or UK).
I correctly see prices in pounds instead of in dollars, British spelling instead of American spelling, apps listed in my purchased tab for the UK (not the US) Apple Account, and, in the Account Settings dialog, the UK Apple Account email address, billing address & Country/Region set to United Kingdom.
I didn't get any relevant results from the following command lines:
defaults find GB
defaults find UK
defaults find uk-apple-id@example.com
defaults find uk-apple-id
The following didn't change after I signed into the UK Apple Account in the App Store:
$ defaults read com.apple.AppStoreComponents
{
ASCLocaleID = "en-US@calendar=gregorian";
}
Maybe Storefront.current?.countryCode only specifies the country code for the Storefront that will be used for in-app purchases, instead of for purchasing new apps from the App Store; maybe the former is tied to the Apple Account for the macOS user, instead of to the Apple Account for the App Store. If that's the case, what other mechanism can I use to obtain the country code for the App Store storefront?
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
For testing purposes, I log out of media and purchases to use sandbox ID's to test in app purchases. Once I log out of media and purchases in device settings, in app purchases is still using my real apple ID, I'm not being prompted anymore to log into a sandbox ID for purchases.
Topic:
App & System Services
SubTopic:
StoreKit
I get crash reports which I can't reproduce when trying to present an SKStoreProductViewController :
Fatal Exception: UIApplicationInvalidInterfaceOrientation
Supported orientations has no common orientation with the application, and [SKStoreProductViewController shouldAutorotate] is returning YES
No matter what app Deployment info orientation I try I can't get my SKStoreProductViewController shouldAutorotate property to return YES. It is always false.
Does anyone knows why or how to get an SKStoreProductViewController to return shouldAutorotate YES?
Topic:
App & System Services
SubTopic:
StoreKit
Hi,
Using StoreKit 2 with App Store Server notifications like so:
User selects a purchase
App calls Product.purchase()
If successful, App Store notifies our backend with the transaction details, importantly with a UUID for the transaction ID.
This works fine, but when I try to test contingent pricing via the handy StoreKit config Transaction Manager in Xcode by creating a PurchaseIntent if I then complete the purchase in the app the Transaction ID is sequential, (0 for the first, 1 for the second etc), which doesn't work for us as the backend might already have that ID stored so the purchase never completes.
If I disable the config file it works fine, but then I can't use the Transaction Manager debug tool. Is there a way to override the ID of a custom transaction that's created via the StoreKit configuration?
Thanks
Hi all,
I have a simple prototype subscription for a recurring monthly for $0.29 cheap!
And it works great!
But it only works great at sub time. It's stuck in the sandbox, constantly giving me "currently subscribed" status even though I’ve done a bunch of things:
Force-quit the app.
Deleted and re-installed it.
Rebooted my phone.
Signed out of media purchases.
Looked on AppStore connect to try to find anything that seems like it’d let me fix this
All efforts in vain.
I'm trying to avoid fully logging out of my iCloud account on my phone. Any other thoughts?
Topic:
App & System Services
SubTopic:
StoreKit
We have a user that's shared screenshots indicating that they're the recipient of a subscription to our app through Family Sharing, but when we look for the transaction in Transaction.currentEntitlements there's nothing there, even after calling AppStore.sync. Should we expect to see a transaction in current entitlements? How can we determine whether it's our bug or Apple's?
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
this error occurred during the StoreKit1 payment process. Could you please tell me the reason?
SKErrorDomain Code=0 "发生未知错误\" UserInfo= {NSLocalizedDescription=发生未知错误,NSUnderlyingError=0x17652ee50 {Error Domain=ASDErrorDomain Code=500"(null)\"Userlnfo={NSUnderlyingError=0x17652d530 {Error Domain=AMSErrorDomain Code=203 "(null)" Userlnfo= {NSUnderlyingError=0x17652c3c0 {Error Domain=AMSErrorDomain
Code=203"(null)\"UserInfo=0x1663e5940(not
displayed)}}}
Hi,
I am experiencing an issue with in-app subscriptions in my React Native application known-singles, using the react-native-iap library. When a user subscribes to a plan, the transaction executes successfully, and a receipt is returned. However, the transaction remains in a pending state indefinitely and does not update. Additionally, the transaction amount is not deposited into my bank account, even though all banking details are correctly set up in App Store Connect.
We have thoroughly debugged the issue on our end but could not identify the cause. TestFlight transactions complete successfully, but real purchases remain stuck in pending status.
Here are the relevant details of our implementation:
React Native version: 0.60.4
react-native-iap version: 4.2.2
Could you please assist in resolving this issue? Any guidance on why transactions are not being completed and why payouts are not being processed would be greatly appreciated.
Looking forward to your support.
Hi All,
We are trying to integrate Promotional Offer in our app, We have a React Native app and are using react-native-iap for handling our in app purchases, as per the documentation we are generating signature in our BE and passing the proper details to the function as well, but for subscription request which have offer applied we are getting the apple pop up properly as well with offer details but when trying to subscribe it gives us SKErrroDomain: 12,
for subscription without applying offer the subscription goes through but when we apply the offer we get the above error.
Our app is currently in Development Stages and has not been sent for review sam for our subscription plans as well.
Please let me know what could be the probable cause for this and help us resolve the issue.
This is the code snippet of ours for the front end :
export const buySubscription = async (subscriptionData: any) => {
try {
if (subscriptionData.offer_id) {
const response = await getSubscriptionSignature(
subscriptionData.productId,
subscriptionData.offer_id,
);
const offerData = response?.data;
const offer = {
identifier: offerData?.offer_id,
keyIdentifier: offerData?.key_id,
nonce: offerData?.nonce,
signature: offerData?.signature,
timestamp: Number(offerData?.timestamp),
};
await requestSubscription({
sku: subscriptionData.productId,
withOffer: offer,
});
} else {
await requestSubscription({ sku: subscriptionData.productId });
}
} catch (err) {
logger.error('Subscription error: ' + JSON.stringify(err));
throw err;
}
};
and
from my python Backend which generates the signature:
def generate_signature(self, product_id: str, offer_id: str) -> dict:
"""
Generate signature for Apple StoreKit promotional offers.
Args:
product_id: The product identifier from App Store Connect
offer_id: The promotional offer identifier
Returns:
dict: Contains signature and required metadata
Reference: https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/subscriptions_and_offers/implementing_promotional_offers_in_your_app
"""
try:
# Generate UUID without dashes and use as nonce
nonce = str(uuid.uuid4())
timestamp = get_current_time_ms() # milliseconds
# Create the payload string in exact order required by Apple
payload_components = [
self.bundle_id, # App Bundle ID
self.key_id, # Key ID from App Store Connect
product_id, # Product identifier
offer_id, # Promotional offer identifier
nonce, # UUID without dashes
str(timestamp) # Current timestamp in milliseconds
]
payload_str = "\u2063".join(payload_components) # Use Unicode separator
logger.debug(f"Signing payload: {payload_str}")
# Create SHA256 hash of the payload
digest = hashes.Hash(hashes.SHA256())
digest.update(payload_str.encode('utf-8'))
payload_hash = digest.finalize()
# Sign the hash using ES256 (ECDSA with SHA-256)
signature = self.private_key.sign(
data=payload_hash,
signature_algorithm=ec.ECDSA(hashes.SHA256())
)
# Encode signature in base64
signature_b64 = base64.b64encode(signature).decode('utf-8')
logger.info(f"Generated signature for product {product_id} and offer {offer_id}")
return {
"key_id": self.key_id, # Changed to match Apple's naming
"nonce": nonce, # UUID without dashes
"timestamp": timestamp, # As integer
"signature": signature_b64, # Base64 encoded signature
"product_id": product_id, # Changed to match Apple's naming
"offer_id": offer_id # Changed to match Apple's naming
}
except Exception as e:
logger.error(f"Failed to generate signature: {str(e)}")
raise HTTPException(
status_code=500,
detail=f"Failed to generate signature: {str(e)}"
)
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit
App Store Connect
Advanced Commerce API
Hi, I want to offer an auto-renewable subscription (e.g., $1/month) that grants users (10 document analyses per month), with the count resetting at the start of each billing cycle.
-Unused analyses will not roll over to the next month-
Additionally, any analyses generated while the subscription is active will remain accessible to the user permanently, even if they cancel the subscription.
The paywall, app description, and metadata will clearly state that the subscription grants (10 document analyses per month with no rollover)
We want this to be implemented as an auto-renewable subscription model, not as a consumable service or a token/credit system (which we want to avoid).
Is this model acceptable under Apple’s guidelines, or would it be considered a token/credit system? Any insights or alternative suggestions would be appreciated.. Thanks
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.))
I confirm that the configured callback address is accurate and can be called using Postman.
The server receives notification messages from IAP
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
App Store Server Notifications
App Store Server API
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
when I have not verified payment method and we choose UPI then pop up shows Purchase In Progress and it shows notification for UPI app payment for apps like Gpay, Paytm. But when we approve or decline this payment StoreKit methods not called for success or failure and we have to kill app to refetch the status and stop the loader.
I am using Store Kit 2 to implement In App Purchases for my app. I need to maintain a pending state in the UI for all my pending purchases. Is there a way to get a list of all pending purchases? If not, is there a way to know if my pending purchase was cancelled?
Does anyone know why I set the offer code in Apple Store Connect, but when I call SKPaymentQueue.default().presentCodeRedemptionSheet() in the app, the app icon does not appear and I cannot find the offer code?
THX
Hello,
I have a question regarding the App Store Server API's getTransactionInfo endpoint.
Previously, the official documentation for getTransactionInfo mentioned that:
“This endpoint doesn’t support an app transaction. To get information about an app transaction, decode the signed app transaction received from the device.”
However, as of June 2025, I can no longer find this sentence in the current documentation (link). Now, the docs state that all in-app purchase transaction IDs are supported (consumable, non-consumable, auto-renewable subscriptions, etc.).
But in practice, when I call getTransactionInfo with an AppTransactionId (extracted from a signed App Transaction JWS), I receive this error: apiErrorCode: 4000048
“Invalid request. App transactions aren’t supported by this endpoint.”
Is this endpoint supposed to support AppTransactionId now, or is the restriction still in place (but not mentioned in the docs)?
Is there any official statement about when this restriction was added/removed?
Can you clarify if only in-app purchase transaction IDs (and not AppTransactionIds) are supported for this endpoint, or has the policy changed recently?
Any clarification or historical context would be greatly appreciated.
Additionally, I would like to know about the behavior of an App Transaction in the event of a refund.
If a user receives a refund for the app itself (not an in-app purchase), how can changes to the AppTransaction be detected?
Does the App Store Server Notification v2 provide notifications for app-level refunds, or are such events only visible by decoding the latest App Transaction JWS on the device?
Is there any way to receive app-level refund information server-side, or must we always rely on the device to provide the updated signed app transaction?
Any clarification on this refund flow and notification coverage would also be appreciated.
Thank you!
Hi, I've migrated my app to another developer account more than half a year ago, but I'm still receiving a few transaction payments in the old developer account, which currently has no app.
The payment date shown in the report is last month.
I'm wondering how could this happen. Is it possible for users to initiate a transaction half a year ago and only successfully pay it now?
I have setup offer codes and subscriptions for users to purchase, when a user signs up using an offer code outside of the app the offer code does not save into my database where the subscriptions are saved
the transaction is successful and validated by store kit but I cant see that that user used an offer code - an example
https://apps.apple.com/redeem/?ctx=offercodes&id=6744338284&code=ASKDOM
I then setup an edge function in supabase to retrieve the data that store kit sends back and im not sure where to find the offer code as it still doesnt save
is there an internal apple reference that they use as apposed to the users offer code i.e offer code askdomSA = P3050 for example
how can Identify if an offer code was used
thank you