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

StoreKit 2 does not change default store location on purchase
Hi, I've implemented a custom StoreKit2 manager, which can handle nonConsumable and autoRenewable products. All works as expected on the developer machine. Problem 1: But when I archive the build, distribute to TestFlight, change to a new system user without Apple ID and starting the app, a login popup appears. There I enter the login data from App Store Connect Sandbox User and a message pops up: If I hit the "Change Store" button, another message pops up which says (in German): "Connection to App Store not possible". Problem 2: Also the paywall shows the translated text for the German test user, but the products are not using their translations. Here is what I did: I've setup 1 nonConsumable product and 2 autoRenewable products in App Store Connect I've translated the products for US in English(default) and German In Xcode I created a synced Products.storekit file The storekit file syncs with App Store and shows all product data and translations correctly In the build scheme I've added the Products.storekit file under Options for "StoreKit Configuration" For every TestFlight build I change the build number On the developer machine: With the storekit file selected, I can change the default Storefront and default localisation through menu entry Debug all data shows correctly and purchasing is possible. Everything works as expected On the test machine: it does not work and shows the dialogs with the title "Account Not in this Store" What am I missing here? Thanks for your help! Arne
0
0
27
2h
Unable to clear Developer Action Needed status from Subscriptions
It's a brand new app that hasn't got its first approval yet. I am including IAP subscriptions with it and after each rejection, I am unable to clear the Developer Action Needed status of the Subscriptions and re-include in the binary for review. To clarify, after I created the Subscriptions I was able to include them in the binary, but after each rejection the Developer Action Needed status is not cleared, even though I edit the descriptions and save. If I update the Localization on each Subscription, they do change status to Prepare for Submission, but the Subscription itself remains on Developer Action Needed. I am having to create a new Subscription Group and Subscription with each rejection from the Review Team, because otherwise I cannot submit them with the binary for review. Can anyone shed some light here? It seems there's a ton of other topics with the same issue that suggest to edit a description, which would then update the status to Ready to Submit but no matter what I try, it won't clear the Developer Action Needed. Thank you
1
0
24
8m
Unable to make a sandbox purchasing with SubscriptionStoreView
Hi I'm writing my first in-app purchase app, and I'm trying to do some testing with sandbox accounts. I wrote my subscription page use SwiftUI SubscriptionStoreView. And I read the documentation it says : The sandbox account appears in Settings > App Store after the first time you use the device to attempt a purchase in a development-signed app. But I have no idea how to make a sandbox purchasing. Every time I click the subscription button it just making a purchase in xcode environment. Did I missed anything? What can I do to make a sandbox pruchasing?
1
0
51
2d
StoreKit Testing with different Country Codes
I am writing unit tests that change the country by setting the .storefront property of SKTestSession to different country codes. I have made sure that the country codes I am using are indeed valid based on ISO 3166-1 alpha-3 region code standards. My default storefront in the StoreKit Configuration file is "USA" but in the unit test, I set it to say "IND" and it runs my test. In the production code, when I print await Storefront.current?.countryCode, I indeed get "IND" as expected. Now when I change the value to say "RUS" by assigning it to the SKTestSession instance, the printed value in production code is still "IND" from the previous assignment. If I call .resetToDefaultState() on the session after first test passes with "IND", it defaults to "USA" but when I set it to "RUS" in my test after it, it stays on "USA". Basically the value does not change after the first change and calling reset resets it to configuration file default but reassigning a new value has no effect on Storefront. What am I doing wrong? Btw, I have tested with both XCTest and Swift Testing but the testing framework has nothing to do with this issue. I am on Xcode 16, macOS 15, Swift 6
1
0
117
3d
Issue with "Transaction.currentEntitlements": Some paid users cannot use the features of our subscription plan
Some paid users are unable to use the paid features unlocked by purchasing our subscription plan. It seems that this is due to StoreKit 2's Transaction.currentEntitlements not working the way we would expect it to work. Are you also encountering this issue? Do you have any idea to improve this situation? At launch, our app checks if the user is subscribed to the plan, using Transaction.currentEntitlements. As a result, the currentEntitlements array was empty. Our app then fetches the products from StoreKit 2 using Product.products(for:). As a result, the Product.SubscriptionInfo.RenewalState value of the corresponding Product (product.subscription.status.first.state) is subscribed, which confirms that the user has indeed purchased our plan, but seems to contradict the absence of the corresponding transaction in Transaction.currentEntitlements. Proactive in-app purchase restore and a restore purchase button calling the AppStore.sync() method are implemented, but using the button did not solve the issue.
0
0
128
6d
Unable to Load IAP Products in App Review Version
Hello everyone, I am encountering an issue with my Vision OS app "Travel Immersive" where it fails to load In-App Purchase (IAP) products in App Review version. The app works perfectly in the local Vision Pro environment which using StoreKit configuration, but when I submit it for App Review, it cannot load any IAP products. Implementation Details: We are using StoreKit 2 to load IAP products. Here is a summary of our implementation: Product Identifiers: We define a set of product identifiers for the IAP products. Loading Products: We use the Product.products(for:) method to load the products asynchronously. Error Handling: We have implemented detailed error handling and logging to capture any issues during the product loading process. Issue Description: Upon launching the app, I receive an error indicating that no IAP products were loaded. Here are the details: Environment: Sandbox Network Connection: All tested URLs returned status code 200, indicating successful connections. Additional Information: The IAP products are currently in the "Waiting for review" status in App Store Connect. I have verified that the product IDs in the code match those in App Store Connect. The app's Bundle ID and Team ID are correctly configured. I am using a valid sandbox test account. Apple App Review Team's Next Step Suggestion: The Apple review team provided the following suggestion: "When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code 'Sandbox receipt used in production,' you should validate against the test environment instead." My Understanding: I believe this suggestion is not applicable to my current issue because the app is unable to load the IAP products in the first place, and therefore, we are not yet at the stage of handling receipts. Additionally, our app is a standalone client application and does not use a server architecture. The primary issue seems to be related to the IAP products not being loaded. Questions: Could the "Waiting for review" status of the IAP products be the reason why they are not loading in the App Review version? Are there any additional steps I should take to ensure the IAP products load correctly in these versions? Is there any other configuration or setting I might be missing? Thank you for your assistance!
1
0
124
6d
Manage Subscriptions prompts for a sandbox user credential that belongs to another app
When I trigger the 'you've already purchased this subscription' alert and go to "Manage" my subscriptions, I'm prompted for a password to: a Sandbox test account that belongs to a different app and I no longer have access to Key Details: I no longer have access to that Sandbox user, as I no longer work for that company. I have long-since removed my AppleID from all of those apps using the appropriate flow to remove myself from their development accounts. As such, I cannot delete these sandbox users myself. I have wicked psychological damage from working at that company, and cannot 'reach out to them' to have them delete the sandbox accounts. I'm taking damage every time I see this alert as it is. I'm NOT logged into my iPhone as a Sandbox tester, but with my AppleID proper. NO purchases/iTunes email separate from my AppleID. The prior AppStore Connect + App that it's asking me for credentials for did not offer subscriptions of any kind. We only use Purchases Sandbox. We DON'T use StoreKit. Questions: Why am I being asked for this when I cannot ever succeed at providing it? How do I work around this problem, so I can view and manage my test subscriptions? Screenshots: This alert: Leads to this alert, which is an email address that belongs to a sandbox account that was created for an entirely different application on an entirely different AppStore Connect account, that I no longer develop for. I want to make this 100% crystal clear that there is no association whatsoever with my current application and the sandbox user this alert is asking me to provide credentials for.
1
0
112
1w
Extra Consent Needed for IAPs if Family Sharing is Disabled?
Hi everyone, I’m developing an game with in-app purchases, designed for a a mixed audience(could be used by kids under 13). I understand that Apple’s Family Sharing has built-in consent mechanisms, like “Ask to Buy,” which helps manage purchases for kids. However, I’m unsure how to handle cases where Family Sharing is not set up or is disabled. Key Concerns: Kids Without Family Sharing: It’s possible for kids to have Apple IDs that are not part of Family Sharing, either because the feature is disabled, set up incorrectly, or the child is using an independent account due to an incorrect birthdate. This raises questions about whether relying solely on Apple’s built-in protections is sufficient. Is It Enough to Rely on Apple’s Systems?: Apple’s systems do a great job of managing consent when Family Sharing is in place, but I’m concerned about compliance in cases where kids are not covered by these protections. I want to ensure that my app remains compliant with COPPA and other relevant regulations, especially for users not covered by Family Sharing, without adding unnecessary layers for those who are correctly set up. Looking forward to your insights and recommendations! Thanks in advance!
0
0
96
1w
Sending main actor-isolated value of type 'PurchaseAction' with later accesses to nonisolated context risks causing data races
Trying to migrate to Swift 6. However getting this error when using SwiftUI StoreKit purchase environment. Sending main actor-isolated value of type 'PurchaseAction' with later accesses to nonisolated context risks causing data races @Environment(\.purchase) private var purchase let result = try await purchase(product)
0
0
173
1w
StoreKit2 with C++ application. How?
Hello all! My application written with C++ and using StoreKit1. For now my application using bridge C++/Objective-CPP/Objective-C/Swift. Since StoreKit1 declared "deprecated" got a question of how to implement correctly StoreKit2 in C++ application, mostly everything about Renewable Subscriptions. StoreKit2 have no direct API in Objective-C, it's available only in Swift. Which is the way the best and correct way: -- for on-device writing C library and in it implement Swift? In this case how to add correctly StoreKit2 into library itself? -- for on-device somehow write kind of wrapper for Swift StoreKit 2 within translation of all of objects in Objective-C and implement it with C++/Objective-CPP bridge? In this case how to add correctly StoreKit2 in C++ project written with CMake? Here https://github.com/compnerd/swift-cmake-examples/tree/main the one of the examples of interoperability C++/Swift with CMake. But how to use exactly with StoreKit2? -- only using server side solution?
4
0
148
6d
SKIncludeConsumableInAppPurchaseHistory not working
I've been trying to test if the StoreKit API returns finished consumables when you fetch all transactions. I added the SKIncludeConsumableInAppPurchaseHistory key to my Info.plist I purchased 2 consumables and verified that they show up when you fetch all transactions before I finish them. But when I fetch all transactions after finishing them, it doesn't contain the finished consumables. Has anyone had success with this or is this a bug? I tested using Xcode Version 16.0 (16A242d) running a macOS Catalyst app on Sonoma 14.7 (23H124). Edit: If I try to get the transaction history using the https://api.storekit-sandbox.itunes.apple.com/inApps/v2/history from my server, I get the transactions back. So it seems like it's a bug on the client side.
2
0
146
1w
Redeem Promo Codes
Hi, I have implemented support for promo codes using StoreKit’s built-in SubscriptionStoreView and have created subscription promo codes in App Store Connect. When pressing the “Redeem Code” button in the SubscriptionStoreView, the “redeem code view” is presented. However, when trying to redeem a code using a released version of the app (downloaded from the App Store), I receive an error message saying the code cannot be redeemed. Does anyone know why this might be happening?
1
0
127
1w
Intermittently Transaction.latest(for:) api returns nil and unverified transaction
We are using method “Transaction.latest(for: productId)” to verify the transaction . Steps to reproduce : Step 1 : User made purchase for productId “product_id_one” Step 2 : “paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])” api returns successful purchase for product_id_one . func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { for transaction in transactions { switch transaction.transactionState { case .purchased: let mProductId = transaction.payment.productIdentifier Print(mProductId) // product_id_one .. Step 3: Call “Transaction.latest(for: product_id_one)” api . guard let verificationResult = await Transaction.latest(for: productId) else { // Here some times its returning nil for valid transaction return } switch verificationResult { case .verified(let transaction): // at time its working fine . we are getting verified purchase . // Check the transaction and give the customer access to purchased case .unverified(let transaction, let verificationError): // Here some times its returning unverified for valid transaction } Issue : For valid purchase , Sometimes Transaction.latest(for: productId) api is returning nil and unverified transaction . This is intermittent  issue.
0
0
85
1w
Clear Purchase History for a Sandbox Apple ID doesn't work
Hello, I'm trying to clear the purchase history made with a sandbox Apple ID on my test device but it does not work. The past purchases are still returned by StoreKit. I've waited many hours but it seems to persist. When I use for await result in Transaction.currentEntitlements { in my app, my non-consumable product is still here. Is it expected? How long should it take to reset the history? Is is supposed to work also for non-consumable products? Thanks Axel
2
0
151
1w
Getting different StoreKit results between SandBox and StoreKitTransactions in Xcode
I’m using ‘Offer Codes’ in App Store Connect for subscriptions. I’m also using a StoreKit implementation that uses the subscriptionStatusTask modifier to assess if the user is subscribed or not. The part I’m not sure of is whether or not the subscriptionStatusTask modifier will recognize the status if the user has used an offer code. I think it should, as that modifier checks for currentEntitlements, and returns appropriately. I’ve been trying to test this out with the StoreKitTransactions system in Xcode, as SandBox does not currently support this. From what I can tell, this way does in fact seem to allow the user to access the app with an offer code. The app does not present the StoreKit view. However, when I’ve tried this with an actual user on the app store (aren’t mom’s great?), the offer code does not take, and they are presented with that StoreKit view. Not great. So can someone please shed some light on this? Is my understanding correct here? What else do I need to do?
0
0
154
2w
OrderLookupResponse of Look Up Order ID API
In what cases does the transaction in the 'signedTransactions' property array respond with more than one transaction? Is it the case that the in-app purchase product type is 'Auto-Renewable Subscription'? https://developer.apple.com/documentation/appstoreserverapi/look_up_order_id https://developer.apple.com/documentation/appstoreserverapi/orderlookupresponse
1
0
184
2w