StoreKit

RSS for tag

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

StoreKit Documentation

Post

Replies

Boosts

Views

Activity

How to verify plain, non-inApp purchase with AppTransaction
Hi all, I'm trying to switch from the 'exit(173)' method to using AppTransaction for a plain, paid app. My current attempt in swift looks like this: Task { let shared = try await AppTransaction.shared switch (shared) { case .verified(let transaction): print("verified <3") case .unverified(let transaction, let error): print("unverified. :'(") exit(0) } } However running this on my dev machine always ends up in the "verified <3" branch. I am ruinning on macOS 15 and am pretty sure that on older systems with the exit(173) method, I would see a window asking me to log into my app store account... I already created a new sandbox account and tried using an empty ".storekit" file... Am I doing something wrong in my code, or is the purchase coming from somewhere else? I already set the bundle-identifier to a non-existent one, but it still seems to think that there was a purchase. Is there any documentation on how to do normal purchase / receipt validation for paid apps using AppTransaction? I only found in-app related docs :'(
1
0
47
7h
I have a question with `isEligibleForIntroOffer(for: groupId)`
I have a question with isEligibleForIntroOffer(for: groupId) that in which case that isEligibleForIntroOfferForGroupId changes from false to true. I found that a few user of our app isEligibleForIntroOffer changes. they used to buy a renewing-subscription with 3-day free trial. but 3 days later. i got from logs their isEligibleForIntroOffer becomes true. We rely on this field to determine whether to display products with free trials. there is only one product with free trial introductory offer.
1
0
74
2d
"purchaseDate" of the Reciepts
I have some questions regarding the specifications of the receipt information that can be obtained from https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info. When a subscription is newly purchased, it is expected that the purchaseDate should reflect the time of purchase and should not be later than this time, such as an hour after the purchase. Is this understanding correct? We observed a phenomenon where, when a user purchased a new subscription between 17:30 and 20:00 JST on November 3, 2024, the purchaseDate in the received receipt was delayed by one hour compared to the actual purchase time. Is this a specification or an issue? When validating the receipt for a newly purchased subscription, if the purchaseDate reflects a time later than when the purchase was made, should I regard the user as having subscription rights at the time of validation?
0
0
82
2d
manage sandbox account clear purchase history not working?
I would like to know whether and how people are getting the sandbox account > manage > clear purchase history feature to work. I clear purchase history (either on my device or at app store connect), and I delete my app from my device. I then run my app from Xcode on my device, and it detects at launch the existence of the purchase, and so I cannot test my purchase user interface. Does this thing actually work as advertised?
0
0
59
2d
Unknown duplicated transactions on Store Kit
Hey team, we are having some unexpected transactions being sent to us by the Store Kit service. Right after we process a transaction, another transaction, with a different id, is received on paymentQueue(_:updatedTransactions:) without the user interaction. This is breaking some of our internal flows and there were some reports of users being charged twice. I'm trying to understand where did these transactions came from and how can we avoid that. Can you help me? I've attached some transactions that had this issue: match_incomplete_purchases.csv
1
0
83
3d
Is Family Sharing included in Transaction.currentEntitlements?
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?
0
0
84
3d
write-review URL query parameter does not work on macOS 15.2
I use the write-review query parameter in my App Store URL to bring up the review prompt in the App Store app: https://apps.apple.com/app/id0123456789?action=write-review (0123456789 is just an example ID, obviously replace that with your app ID) This is exactly what is supposed to be done as per the documentation: https://developer.apple.com/documentation/storekit/requesting_app_store_reviews#4312600 However, on macOS it just opens the product page as if I never put the query parameter in the URL. It works fine on iOS 18.2. I am using macOS 15.2 beta 3 (24C5079e) Feedback ID: FB15866683
1
0
85
4d
Failure during payment with sandbox account
I got this error if I buy my IAP on the simulator with a sandbox account. Any solutions? On android it's working very well. &lt;SKPaymentQueue: 0x6000018b8430&gt;: Payment completed with error: Error Domain=ASDErrorDomain Code=530 "(nu11)" UserInfo={NSUnderlyingError=0x600001512970 (Error Domain=AMSErrorDomain Code=100 "Authentication Failed The authentication failed." UserInfo={NSMultipleUnderlyingErrorsKey=( "Error Domain=AMSErrorDomain Code=2 \"Password reuse not available for account The account state does not support password reuse.\" UserInfo={NSDebugDescription=Password reuse not available for account The account state does not support password reuse., AMSDescription=Password reuse not available for account, AMSFailureReason=The account state does not support password reuse.}", "Error Domain=AMSErrorDomain Code=0 \"Authentication Failed Encountered an unrecognized authentication failure.\" UserInfo={NSDebugDescription=Authentication Failed Encountered an unrecognized authentication failure,, AMSDescription=Authentication Failed, AMSFailureReason=Encountered an unrecognized authentication failure,}" ), AMSDescription=Authentication Failed, NSDebugDescription=Authentication Failed The authentication failed., AMSFailureReason=The authentication failed,}}, storefront-country-code=USA, client-environment-type=Sandbox)
2
0
119
4d
Facing issue on getting inApp procuts
I have created 5 consumable products on store but when i am trying to check on mobile using xcode with debug mode i am get fetching products successfully can u guys help me out why its happening. here is debug error --IAPTest[5101:295128] UnityIAP: Requesting 5 products --IAPTest[5101:295128] UnityIAP: Requesting product data... --IAPTest[5101:295371] UnityIAP: Received 0 products and 5 invalid products i have test same project with another apple account's app bundle ID or iAP products its working fine have a look of those app's debug screen show Perfect Not Perfect
2
1
98
6d
StoreKit 2 failure on tvOS 18.2
Please help! I have a subscription IAP failing on tvOS 18.2 at: func makePurchase(_ product: Product) async throws { let result = try await product.purchase() //ERROR OCCURS HERE (See error message below) ... Xcode Console message: "Could not get confirmation scene ID for [insert my IAP id here]" The IAP subscription was working fine on 18.1 and earlier, and the same IAP and code is also running fine on iOS 18.2. The tvOS error on 18.2 happens both in production and sandbox. Are there any changes to StoreKit 2 which might cause this error?
3
0
161
1w
StoreKit in IOS 18
I have has a the Storekit working in my application previously. It uses the a iTunes songs ID and allows the user to purchase the track from iTunes within the app using a View. its been fine in IOS 17 but since the update to 18 Ive not been able to get this to work. the iTunes panel loads within the app and shows the track I wish to purchase. on clicking purchase I login with my Apple ID password. that then spins for a few seconds then asks to do the purchase again. Can you please advise. code below print ("Store ID + \(self.appId)") let storeProductViewController = SKStoreProductViewController() storeProductViewController.delegate = self let parameters = [SKStoreProductParameterITunesItemIdentifier: self.appId] storeProductViewController.loadProduct(withParameters: parameters) { status, error -> Void in if status { self.present(storeProductViewController, animated: false, completion: nil) print("success: \(status.description)") } else { if let error = error { print("Error: \(error.localizedDescription)") } } } DispatchQueue.main.async { self.isPresentStoreProduct.wrappedValue = false } }
1
1
152
1w
In-App Purchase Refund Procedure
Hi everyone, I was just wondering if anyone could point me in the right direction on how to properly handle inquiries about refunding in-app purchases. I've seen multiple posts saying to direct them to Apple's support, but is there no other direct way of handling this? Also, does Apple not provide an API to interface with so you can issue refunds on behalf of the customer? Thanks.
3
0
170
1w
Offer Code Transaction
Hello, We're trying to implement and test offer codes in our app. We have create all the necessary items in the App Store. The app has been reviewed and approved for release. We have not published it yet. We are redeeming the offer using a URL that opens the App Store. When I redeem, the account is updated, but the app does not see the Transaction. We implemented using this: https://developer.apple.com/documentation/storekit/transaction First, we used the Transaction.updates and then we added Transaction.all and neither return any Transaction. Any ideas with there are any other dependencies that are required here or recommendations for how to test?
4
0
116
1w
Landscape safe area is incorrect when presenting SKStoreProductViewController
Hi. If the app is in landscape only and when the SKStoreProductViewController is presented, the safeArea changes to what looks like a portrait mode safe area. When the SKStoreProductViewController is dismissed, the safeArea does NOT revert back to the original values. Is there a way to force the safeArea to "reset"? I've submitted some bug tickets through Apple Feedback but I haven't received any response about it. The below code will pop up the SKStoreProductViewController and if you have a UIView that is constrained to the safe area, then you can visibly notice that the safe area is changed and doesn't go back. I have tested this on iPhone 14 Pro, iPhone 15, and iPhone 16 Pro and in the Simulators. The incorrect behavior happens on those and probably more. Thanks. #import "ViewController.h" #import &amp;lt;StoreKit/StoreKit.h&amp;gt; @interface ViewController () @property (nonatomic, strong) SKStoreProductViewController *productViewController; @end @implementation ViewController - (IBAction)buttonTapped:(id)sender { self.productViewController = [[SKStoreProductViewController alloc] init]; NSDictionary *parameters = @{ @"id" : @"6443575749" }; [self.productViewController loadProductWithParameters:parameters completionBlock:^(BOOL result, NSError * _Nullable error) { [self presentViewController:self.productViewController animated:YES completion:^{ // presented // The panel that is constraint to the safe area visibly shows that the safe area is no longer correct. }]; }]; } @end
0
1
183
2w
Implementing In-App Purchases for the first time
Hi, I want to apply in app purchases in my app. I have set it up in xcode and on appstoreconnect, it is saying ready to submit. I dont understand what i need to do now to connect the two. I have read i need to send my app for review for them to be reviewed, but i want to test the in app purchases first on test flight and on sandbox before i send my app for review. Please can someone clarify for me and help me?
1
0
139
2w
How to remove Subscription from Review
The guidance provided only explains how to remove the entire app from review, but not how to remove a single subscription. Currently, I have one incorrect subscription that has been rejected due to localisation issues, and it is stuck in the "In Review" status. Unfortunately, I am unable to make changes to it. The correct subscription is in the "Waiting for Review" status, and while I am able to remove it, there is no need to do so. What I would like to do is remove the previous, incorrect subscription.
0
0
116
2w