StoreKit

RSS for tag

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

StoreKit Documentation

Posts under StoreKit tag

349 Posts
Sort by:
Post not yet marked as solved
0 Replies
8 Views
Hi, We manage in-app purchases/subscriptions and their notifications in an server-to-server setup. We currently updated one of our devices to iOS 17. The sandbox subscription management is still not working, we encountered the same issue on iOS 16. When trying to access the sandbox subscription management menu, the authentication steps works correctly, but after that we get a error screen with the message: Cannot Connect. There is a retry button, but the same error message is prompted, after it is pressed We have this working on devices which have iOS 15.x versions. Are there any investigations or updates on this subject? Are there any workarounds to make this work? Thanks, David
Posted Last updated
.
Post not yet marked as solved
1 Replies
175 Views
Our requirement: In a viewcontroller, there are two parts: upper part: Video View lower part: SKStoreProductViewController's view In order to implement it, we add video view in the container VC, and add SKStoreProductViewController as child VC, so that we can add SKStoreProductViewController view in the lower area. It works well before iOS 17. But in iOS 17 beta, we found that there's is a ServiceCardContainerViewController laying on our container VC, and in this ServiceCardContainerVC, there's a SKProductPageRemoteViewcontroller almost cover all the window. And we can not find any info about ServiceCardContainerViewController and SKProductPageRemoteViewcontroller. So this is a bug or new feature for StoreKit? 🤔
Posted
by nimomeng.
Last updated
.
Post not yet marked as solved
0 Replies
32 Views
I have been using the Offer Codes that can be generated in App Store Connect (up to 25k per quarter). They had worked before, but at some point of time they just stopped working. My production device (iPhone 13 Pro) doesn't even render the redemption screen properly and says the code expired, even if it didn't. (already submitted a bug report, sadly without answer till this day: https://feedbackassistant.apple.com/feedback/12261784) Apart from that, I asked some friends to try to redeem a test offer code for me and surprisingly, the native redemption screen is rendered properly, but the code cannot be redeemed. (Clicking "Redeem" doesn't show the payment sheet) Any idea what the cause can be and how to fix it? To me it looks like it is a problem with StoreKit API, because I followed the documentation on how to use the native iOS offer code redemption sheet and I don't even receive an app store notification. Looks like there is a problem between the device and Apple's API.
Posted Last updated
.
Post not yet marked as solved
2 Replies
67 Views
We send StoreKit 2 signed transactions to our server for validation and processing. As part of this process, as recommended by Apple, we validate the certificate chain against the "Apple Root CA - G3 Root" certificate found here: https://www.apple.com/certificateauthority/ As of 24th September we started noticing this validation erroring because of expired certificates in the JWT. On further investigation we see the first cert in the chain, with the common name "Prod ECC Mac App Store and iTunes Store Receipt Signing", appears to have expired at "Sep 24 02:50:33 2023 GMT" I checked and calling the App Store API at "inApps/v1/subscriptions/" with the same transaction id also returns the subscription with the same expired certificate in the chain so I am confident that this is a genuine transaction issued by Apple. For now we have been forced to disable validating the expiry date of intermediate certificates to work around this. I'm however really surprised I haven't found anyone else discussing this or any documentation around how to handle this situation. Is it expected that the App Store JWS would contain an expired certificate and what is the guidance on how to proceed in this situation?
Posted Last updated
.
Post not yet marked as solved
2 Replies
156 Views
I want to use the newer APIs in the Store Kit to validate receipts. The methods to do this are described in the documentation but with one thing missing - the necessary frameworks and headers. Linking against the AppKit and StoreKit frameworks doesn't help. What frameworks and headers would I need to get XCode to recognize for example, AppTransaction? Also some of the documentation is in Swift only. Is this a subtle hint that Apple is moving towards a Swift-only development environment?
Posted
by Tlaloc.
Last updated
.
Post not yet marked as solved
0 Replies
48 Views
Hi, If I want to stop purchasing new auto-renewing subscriptions, but continue the subscriptions of existing subscribers, can I simply remove the purchase leads on the app side? I am concerned that they can purchase from "Subscriptions", "View All Plans" in the Settings app. It would be helpful if you could give us a lecture on how to continue existing subscribers and stop new purchases only.
Posted
by udonlover.
Last updated
.
Post not yet marked as solved
11 Replies
1.6k Views
I'm using the iOS simulator with a StoreKit configuration file. I can see that there have been transactions while the app has been closed, but my StoreKit 2 listener is never called with those updates to be able to finish them When I open my app from a cold start. I've added a listener on application(_:didFinishLaunching:launchOptions:) like this: func startObservingTransactions() { task = Task(priority: .background) { for await result in Transaction.updates { if case .verified(let transaction) = result { await transaction.finish() } } } } But the Transaction.updates loop never gets called (have added breakpoints to check). It's only ever called when a purchase is made, or subsequent transaction renewals when the app is open. Only then it will get the previously unfinished transactions. Steps to reproduce: Create an app with a StoreKit config file (with sped up transactions) to purchase an item Make a purchase then quit the app Wait for a bit for more transactions to be made while the app is closed. Open the app from a cold start and none of the transactions will be finished by the listener in your app. Cancel the subscription via the transaction manager. Close and open the app from a cold start. The first transaction will be finished by the listener but none of the others will be. In Apple's docs it says If your app has unfinished transactions, the listener receives them immediately after the app launches Why is this not the case?
Posted
by itsyusuf.
Last updated
.
Post not yet marked as solved
0 Replies
50 Views
In order to conduct sandbox in-app purchase testing, a testuser needs to be added to Apple Connect. This user cannot be me. It has to be someone who is NOT associated with ANY other developer account. Otherwise you'll get an error while adding test-user. So, I tried to create a new iCloud user. I confirm the email, verify phone number with an SMS, and then within 10 minutes, I'm locked out from this new account out because the "verification fails". Is Apple's logic that, in order to test an in-app purchase in sandbox, one needs to purchase a new device and create a new iCloud account under another person's name and also make a new SIM-card so the phone number would be fresh?
Posted
by Chhhhh.
Last updated
.
Post not yet marked as solved
0 Replies
68 Views
I cannot call productID in StoreKit2. I am getting the following error. [Default] [StoreKit] Did not receive any products or error for products request. I'm calling with this code. productAppID contains the product ID set in App Store Connect. var storeProducts:[Product]. storeProducts = try await Product.products(for: [productAppID])]
Posted
by tekurou.
Last updated
.
Post not yet marked as solved
6 Replies
2.8k Views
Hi, My app is currently in review (wasn't approved yet). I'm using the Get Transaction History API with a sandbox user transaction ID. I successfully get results when using the sandbox url (https://api.storekit-sandbox.itunes.apple.com/inApps/v1/history/{originalTransactionId}) However, when using the production url (https://api.storekit.itunes.apple.com/inApps/v1/history/{originalTransactionId}) - I'm consistently getting 401 - unauthorized, which according to the doc means something is wrong with my JWT. Should I generate my JWT differently for sandbox vs production? If not, what else could cause this issue? Thanks,
Posted
by liorke.
Last updated
.
Post not yet marked as solved
3 Replies
436 Views
When attempting to sync storeKit configuration from App Store Connect, an error message stating 'An unknown error occurred when syncing from App Store Connect' is displayed. Xcode: Version 14.3.1 (14E300c) App BundleID is same with setting in App Store Connect.
Posted
by Kangnux.
Last updated
.
Post not yet marked as solved
0 Replies
53 Views
Using a modified version of the following example var body: some View { NavigationSplitView { BackyardList(isSubscribed: isSubscribed, backyardLimit: passStatus.backyardLimit, onOfferSelection: showSubscriptionStore) .navigationTitle("Backyard Birds") .navigationDestination(for: Backyard.ID.self) { backyardID in if let backyard = backyards.first(where: { $0.id == backyardID }) { BackyardTabView(backyard: backyard) } } } detail: { ContentUnavailableView("Select a Backyard", systemImage: "bird", description: Text("Pick something from the list.")) } .sheet(isPresented: $showingSubscriptionStore) { SubscriptionStoreView(groupID: groupID) } .onInAppPurchaseCompletion { _, purchaseResult in guard case .success(let verificationResult) = purchaseResult, case .success(_) = verificationResult else { return } showingSubscriptionStore = false } } (from Apple's sample code demonstrating in-app purchases), I'm unable to complete a sandbox purchase on Apple Watch. I get the error in the UI Unable to Purchase App Sign in with your Apple ID from the Apple Watch app on your iPhone and printing purchaseResult outputs failure(StoreKit.StoreKitError.unknown). An Apple ID is signed into Settings on iOS, as well as the Apple Watch app. This occurs whether or not a separate sandbox Apple ID is signed into Settings under App Store. The subscription options UI appears as expected before attempting to purchase one.
Posted Last updated
.
Post not yet marked as solved
1 Replies
75 Views
Hello! While testing our product in Xcode 15 / iOS 17 (beta 8 and RC confirmed, possibly earlier beta versions, too), we found that the loadProduct(withParameters: completionBlock:) method was no longer working as expected. In a simple test app, both in an objective-c and swift app, found that if the app ID value passed in the parameters dictionary was invalid (i.e., GARBAGEID), or if the app ID value was for an app that was not available in the my app store's registered country, the completion block would be triggered with a result value of true and an error object that was nil. Based on the support documentation for the loadProduct function (seen here), these values when found in the completion block indicate that a product view was successfully loaded - which is not true. In Xcode, I can also see the following in the log: [<SKProductRemoteViewTask: 0x280d585a0>][D908F912]: Lookup completed with error: Error Domain=ASDErrorDomain Code=512 "(null)" This error, while presented, is not surfaced to my application and is not included in the completion block error result. I can also see an empty SKStoreProductViewController on the view hierarchy. This has the effect of presenting an empty controller to the user, which can interrupt operations on the current screen (make it look like a video, or another on screen operation, has paused unexpectedly). Would really appreciate help resolving this, either through identifying something in the returned controller that would tell us if the product view was successfully loaded, or by identifying when this might be addressed. Thanks! Clarke Bishop
Posted
by cbishop.
Last updated
.
Post not yet marked as solved
5 Replies
395 Views
Hello, I experience a serious issue where calling presentViewController: animated: on SKStoreProductViewController is executed and completion is called, but the view controller isn't visible on screen. The system thinks that it's the presentedViewController, and my presentingViewController is frozen. Tapping the screen prints a weird Console log of dismissViewControllerAnimated on SKStoreProductViewController. The code is executed inside an SDK that is integrated in apps, and the issue occurs only in some of the apps. Any idea what could cause this issue? Thanks!
Posted
by k1ddogal.
Last updated
.
Post not yet marked as solved
4 Replies
773 Views
Suddenly in-app purchases of already productive IAPs are failing in the production with the error code: NSUnderlyingError=0x283b42e20 {Error Domain=ASDServerErrorDomain Code=3504 "找不到此项目。" UserInfo={NSLocalizedDescription=找不到此项目。}}} Environment: Production OS Version:iOS 15.6.1 I confirm that there have been no prohibited sales areas for the product I want to know What does Code 3504 represent? Where can I find documentation related to error codes?
Posted Last updated
.
Post not yet marked as solved
2 Replies
362 Views
Hello, I have a production issue with StoreKit2. My app has a renewal subscription, people can subscribe and get their benefits. The issue occurs when I release a new version of the app, as soon as subscribed people install the update they loose their benefits because the transaction is detected as unverified by storeKit2. If they delete the app and reinstall everything works properly again until the next app update. It hard to debug because it happens only in production. It is very frustrating and I have no idea how to solve this issue. The only solution I have though of is to remove the transaction verification. Thanks for your help, Cédric
Posted
by xploit.
Last updated
.
Post not yet marked as solved
6 Replies
824 Views
Hi, I'm working on moving an app's in-app purchases from Store Kit to StoreKit2 and whilst running in TestFlight I'm getting a "There is no information for In-App Purchases" error every two out of three purchase attempts. The third attempt usually throws up a "You've already purchased this" dialog and finishes purchasing the subscription within my app. From what I can see, I'm not getting this back as an error from a call to anything, the error is being displayed by the OS. I'm not sure if it's something in my code, something in my product setups which is causing it, or something-else. Any help would be useful, I don't want o push out the update if the in-app purchases aren't working. Cheers, Rich
Posted
by Rich_UK.
Last updated
.
Post not yet marked as solved
1 Replies
989 Views
I am using local receipt validation and the SKReceiptRefreshRequest API to restore purchases. When my iOS 16.1 users tap "restore purchase", the call fails. Notably, it does not ask the users to log into their iTunes account (it normally does) and my app logs the following error: <SKReceiptRefreshRequest: 0x281b0ad20>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=603 "Request throttled" UserInfo={NSLocalizedFailureReason=Unified receipt is valid and current, NSLocalizedDescription=Request throttled, AMSServerErrorCode=0} These errors started showing up after the release of 16.1 and appear to be limited to that specific version of iOS. The relevant code has not changed in years and I have iOS 15 and iOS 16.0 users who are currently able to restore purchases without issue. Also, I am not able to reproduce the issue in the sandbox but I am able to do so in production. I'm a bit at a loss. Why would my request be "throttled" and, further, why only on iOS 16.1 and only in production? Any thoughts on what could be happening here? Any help is much appreciated. Thank you!
Posted
by giggybank.
Last updated
.