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

Error in remote proxy while processing transaction: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.storekitd"
I am working on a billing implementation in UnityIAP. Recently, when I press the billing button on iOS, I get an Unknown error the first time, I checked the logs and found the following error. <SKPaymentQueue: 0x2823b65c0>: Error in remote proxy while processing transaction: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.storekitd" UserInfo={NSDebugDescription=connection to service named com.apple.storekitd}\ Special conditions, When this is occurring, addTransactionObserver is being called after the purchase order. If addTransactionObserver is called for a paymentQueue during the purchase process, would this error be called? Or if there is any problem on the AppleStore side, I would appreciate it if you could let me know. Thank you in advance.
3
0
1.8k
Dec ’23
StoreKit2: Transaction.currentEntitlements returns expired subscriptions (Testing locally with shortened sub periods)
Hi, title says it all: I have Transaction.currentEntitlements returning expired subscriptions (testing both transaction expirationDate & RenewalState). Environment: local via .storekit file. Subscription duration is shortened for testing. Could it be the issue? The sub duration is normally 1 year. The documentation says it should only returns active subscription (RenewalState.subscribed) or in grace period (RenewalState.inGracePeriod).
2
1
1.3k
Jan ’24
Tracking clicks on SKOverlay
I'm currently working with SKOverlay in my iOS app and I'm trying to track user clicks on the overlay. I've explored a few solutions but haven't been able to find a reliable method for capturing these clicks. I would appreciate some guidance or suggestions on how to achieve this. Any advice or code examples would be greatly appreciated. Thank you in advance for your help!
1
0
774
Jun ’24
macOS TestFlight app using Xcode environment for IAP
I don't know how this happened or how to reset this, but I can't test the StoreKit part of my TestFlight app anymore. When I try to retrieve or buy products (IAPs), I get all kinds of strange behavior. I think it is caused by storekitagent thinking the app is in "Xcode sandbox environment". One of the errors from storekitagent looks like this: [51852D62] [LoadSubscriptionStatusTask]: Subscription status request failed with error - Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={AMSStatusCode=0, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <468756B3-DA53-4FED-B35C-E093954C27D8>.<1>, NSErrorFailingURLKey=http://localhost:49828/inApps/subscriptions?guid=98DD60024C21&reason=push, _kCFStreamErrorDomainKey=10, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <468756B3-DA53-4FED-B35C-E093954C27D8>.<1>" ), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=http://localhost:49828/inApps/subscriptions?guid=98DD60024C21&reason=push, NSUnderlyingError=0x122f638d0 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: lo0, _kCFStreamErrorCodeKey=-72000, _kCFStreamErrorDomainKey=10}}, _kCFStreamErrorCodeKey=-72000} It looks like it's trying to connect to a local server instead of contacting Apple's App Store servers. I'm on the latest macOS and Xcode. Any help is greatly appreciated:) Thanks!
4
1
1.3k
Jan ’24
StoreKit testing in XCode
I'm trying to use StoreKit testing in XCode, but not work. It go through all steps in iPhone side on the purchase workflow e.g. prompt that telling me the purchase won't charge me as it is for testing only (purchase a consumable item through our app) but it fail finally. The problem is we follow Apple workflow: iphone post the receipt to our server and our server will send the receipt to https://sandbox.itunes.apple.com/verifyReceipt for validation, however, we receives a non-zero status value from apple (21002). Any idea what we missing in setup ?
1
0
725
Oct ’23
No SHA-256 intermediate certificate for Sandbox, still SHA-1 signature
As indicated on the website below the sandbox should now have a SHA-256 signature for new purchases starting on June 20, 2023 for apps running in iOS 16.6 and higher. I tried with iOS 17 beta, still getting a SHA-1 signed receipt. Has anybody managed to get a SHA-256 signed receipt? TN3138: Handling App Store receipt signing certificate changes | Apple Developer Documentation
6
2
1.5k
Sep ’23
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.
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.
5
1
1.4k
Sep ’23
Bug Report: Empty Product.products on Initial App Launch in iOS 17
Description: In iOS 17, there is a bug where the Product.products() method from StoreKit returns an empty array on the first launch of the app after installation. However, subsequent launches of the app do not have this issue, and the product array is populated correctly. This problem can be reproduced by deleting and reinstalling the app. It should be noted that this bug is specific to iOS 17, as iOS 16 and iOS 15 do not exhibit the same behavior. Reproduction Steps: Install the app on an iOS 17 device. Launch the app for the first time. Notice that the product array is empty. Close the app. Reopen the app. Verify that the product array is no longer empty. import SwiftUI import StoreKit struct ContentView: View { var body: some View { VStack { Text("Products are empty on initial app launch in iOS 17") }.task { let products = try? await Product.products(for: ["premium"]) print(products) } .padding() } }
1
0
706
Nov ’23
Crash when displaying SKAdnetwork product page on iOS 17 beta
Description On iOS 17.0 beta, when trying to display a product page with SKStoreProductViewController, "Call must be made on main thread" error occured and the app crashes. The completionBlock in the loadProductWithParameters method is is being called outside of the main thread. This phenomenon does not occur in versions prior to iOS 17.0 beta. The documentation states, "The completion block is called on the main thread and receives the following parameters" Since iOS 17.0 beta, the specification and the actual behavior seem to be different. Is this issue going to be fixed? This issue also occurs in the latest environment at this time, iOS 17.0 beta 3 and Xcode 15.0 beta 4. Log The following is a log of the results of running loadProduct according to this document. Main Thread Checker: UI API called on a background thread: -[UIViewController presentViewController:animated:completion:] PID: 11963, TID: 946567, Thread name: (none), Queue name: com.apple.NSXPCConnection.m-user.com.apple.storekitd, QoS: 0 Backtrace: 4 SkanApp 0x000000010433832c __43-[ViewController loadProductViewController]_block_invoke + 108 5 StoreKit 0x00000001d039c1a0 883E1703-40F8-362A-AF04-0D5DF2F54C60 + 164256 6 StoreKit 0x00000001d03aae30 883E1703-40F8-362A-AF04-0D5DF2F54C60 + 224816 7 CoreFoundation 0x00000001a81085c4 5580A260-85DE-375D-933E-4E6035C60CC1 + 484804 8 CoreFoundation 0x00000001a80b5ac0 5580A260-85DE-375D-933E-4E6035C60CC1 + 146112 9 Foundation 0x00000001a7159e64 D9049983-394E-3B07-894C-BF9802EDFCBA + 646756 10 Foundation 0x00000001a712c1e4 D9049983-394E-3B07-894C-BF9802EDFCBA + 459236 11 Foundation 0x00000001a785eea0 D9049983-394E-3B07-894C-BF9802EDFCBA + 8007328 12 libxpc.dylib 0x000000020f92fc14 A4D8D736-F9EE-3A24-9DE7-AFB0E13A8083 + 125972 13 libxpc.dylib 0x000000020f922584 A4D8D736-F9EE-3A24-9DE7-AFB0E13A8083 + 71044 14 libdispatch.dylib 0x00000001050bec1c _dispatch_client_callout3 + 20 15 libdispatch.dylib 0x00000001050ddd08 _dispatch_mach_msg_async_reply_invoke + 392 16 libdispatch.dylib 0x00000001050c682c _dispatch_lane_serial_drain + 376 17 libdispatch.dylib 0x00000001050c77c4 _dispatch_lane_invoke + 460 18 libdispatch.dylib 0x00000001050d4658 _dispatch_root_queue_drain_deferred_wlh + 328 19 libdispatch.dylib 0x00000001050d3c8c _dispatch_workloop_worker_thread + 444 20 libsystem_pthread.dylib 0x000000020f8cee50 _pthread_wqthread + 288 21 libsystem_pthread.dylib 0x000000020f8cebf0 start_wqthread + 8 Unsupported enumeration of UIWindowScene windows on non-main thread. Unsupported enumeration of UIWindowScene windows on non-main thread. Unsupported enumeration of UIWindowScene windows on non-main thread. Unsupported enumeration of UIWindowScene windows on non-main thread. Unsupported enumeration of UIWindowScene windows on non-main thread. Unsupported enumeration of UIWindowScene windows on non-main thread. Unsupported enumeration of UIWindowScene windows on non-main thread. *** Assertion failure in -[UIApplication _performAfterCATransactionCommitsWithLegacyRunloopObserverBasedTiming:block:], UIApplication.m:3,205 warning: Module "/Users/***/Library/Developer/Xcode/iOS DeviceSupport/iPhone15,3 17.0 (21A5248v)/Symbols/usr/lib/libobjc.A.dylib" uses triple "arm64e-apple-ios17.0.0", which is not compatible with the target triple "arm64-apple-ios11.0.0". Enabling per-module Swift scratch context. environment iOS 17.0 beta ~ iOS 17.0 beta 3 iPhone 14 Pro Max Xcode 15.0 beta ~ Xcode 15.0 beta 4
2
0
1.3k
Jul ’23
Transaction.currentEntitlements is not consistent
I've recently published an app, and while developing it, I could always get consistent entitlements from Transaction.currentEntitlements. But now I see some inconsistent behaviour for a subscribed device in the AppStore version. It looks like sometimes the entitlements do not emit value for the subscriptions. It usually happens on the first couple tries when the device goes offline, or on the first couple tries when the device goes online. But it also happens randomly at other times as well. Can there be a problem with Transaction.currentEntitlements when the connectivity was just changed? Of course my implementation may also be broken. I will give you the details of my implementation below. I have a SubscriptionManager that is observable (irrelevant parts of the entity is omitted): final class SubscriptionManager: NSObject, ObservableObject { private let productIds = ["yearly", "monthly"] private(set) var purchasedProductIDs = Set<String>() var hasUnlockedPro: Bool { return !self.purchasedProductIDs.isEmpty } @MainActor func updatePurchasedProducts() async { var purchasedProductIDs = Set<String>() for await result in Transaction.currentEntitlements { guard case .verified(let transaction) = result else { continue } if transaction.revocationDate == nil { purchasedProductIDs.insert(transaction.productID) } else { purchasedProductIDs.remove(transaction.productID) } } // only update if changed to avoid unnecessary published triggers if purchasedProductIDs != self.purchasedProductIDs { self.purchasedProductIDs = purchasedProductIDs } } } And I call the updatePurchasedProducts() when the app first launches in AppDelegate, before returning true on didFinishLaunchingWithOptions as: Task(priority: .high) { await DependencyContainer.shared.subscriptionManager.updatePurchasedProducts() } You may be wondering maybe the request is not finished yet and I fail to refresh my UI, but it is not the case. Because later on, every time I do something related to a subscribed content, I check the hasUnlockedPro computed property of the subscription manager, which still returns false, meaning the purchasedProductIDs is empty. You may also be curious about the dependency container approach, but I ensured by testing multiple times that there is only one instance of the SubscriptionManager at all times in the app. Which makes me think maybe there is something wrong with Transaction.currentEntitlements I would appreciate any help regarding this problem, or would like to know if anyone else experienced similar problems.
4
4
1.4k
Nov ’23
StoreKit 2/StoreKit for Paid to Fremium Migration
I am trying to migrate my app from paid to freemium and am facing several issues and doubts. Specifically, I am trying to use StoreKit2 AppTransaction API but I am not averse to using StoreKit if my problems are not solved by StoreKit2: Here are my questions: AppTransaction/Receipt on launch: I see on launch the AppTransaction.shared call fails on the sandbox initially. That means it's possible that on user's who have purchased the app previously, the AppTransaction (or appStoreReceipt in original StoreKit) may not be available when the user downloads or updates the app? That means I will need to ask every user to authenticate with AppStore to refresh the receipt/AppTransaction? Volume Purchase Users: I see StoreKit2 is not advised for volume purchases on the Apple website. I am not sure why that is the case, but does that mean AppTransaction will not be available for users who made Volume purchases under VPP? Is the flow to validate VPP users different? If StoreKit 2 can not be used, can the original StoreKit API help here, or nothing can be of help here?
1
0
832
Nov ’23
StoreKit 2: Newly added subscription not being returned
Hi, In App Store Connect, I have added a new subscription to an existing subscription group and it has been approved by the App Store. The Problem: In my development environment, the existing 6 products are returned, but the new 7th product is not being returned. What I have checked: New subscription is Approved, Product code is correct. Simulator device is logged in as Sandbox Tester ID. No errors from Product.products(for:). Region is correct. Waited 36 hrs for propagation Paid apps agreement is current Any more troubleshooting ideas? Thanks in advance
6
1
517
Jul ’23
What steps to perform for the upcoming changes to the App Store receipt signing intermediate certificate?
Currently, my app validates App Store receipts on the device, so as per this news, I need to make changes to it, But I am unable to make a decision on where I should start, Can anyone please help me out on this? Do I need to make changes in the device receipt validation? If yes, what steps should I take? OR Should I do the receipt validation from the server side? If yes, then what steps to follow to make a receipt validation on the server? Your suggestions will be highly appreciated.
9
0
1.4k
Jul ’23
refundRequestSheet done button is not working properly
I am having an issue with refundRequestSheet. So basically, my issue is that everything is presented just fine, I can get through the refund process, but at the end of the process where we are having done button, after I press the done button nothing is happening, result is not being called - it looks like the button is not actually calling any action. The only way for me to close the screen is to actually swipe the sheet down, and then the result of onDismiss sometimes is failure and sometimes is a success. I also investigated other type of sheets such manageSubscriptionsSheet, and this is having the same issue basically. I tested two models, the iPhone 6S had this problem, the iPhone 14ProMax did not have this problem. .refundRequestSheet(for: viewModel.transactionID ?? 0, isPresented: $viewModel.showRefundSheet, onDismiss: { _ in viewModel.showRefundSheet = false })
1
0
225
Jul ’23
Apple Developer Enrollment throws error before authorizing payment, How to proceed?
I am trying to enroll to Apple Developer Program. It throws Unknown Error has occurred before I get the payment request. First time I even accepted the payment request, paid the amount. But enrollment didnt work. Second time I noticed that it fails before I even get chance to accept the payment request. I get the request after 20 seconds or so.
0
0
342
Jul ’23
api.storekit.itunes.apple.com/inApps/v1/history Get Empty signedTransactions
I try to migrate the verification process of the server . From https://sandbox.itunes.apple.com/verifyReceipt to https://api.storekit.itunes.apple.com/inApps/v1/history/{transactionId} When I execute the following API : https://api.storekit-sandbox.itunes.apple.com/inApps/v1/history/2000000376851165 Get the following result : { "revision": "0", "bundleId": "com.jfigames.GameModelSlot", "environment": "Sandbox", "hasMore": false, "signedTransactions": [] } What confuses me is that signedTransactions is empty. Here is the Receipt using verification from https://sandbox.itunes.apple.com/verifyReceipt: { "receipt": { "receipt_type": "ProductionSandbox", "adam_id": 0, "app_item_id": 0, "bundle_id": "com.jfigames.GameModelSlot", "application_version": "2000001", "download_id": 0, "version_external_identifier": 0, "receipt_creation_date": "2023-07-27 02:41:06 Etc/GMT", "receipt_creation_date_ms": "1690425666000", "receipt_creation_date_pst": "2023-07-26 19:41:06 America/Los_Angeles", "request_date": "2023-07-27 06:10:04 Etc/GMT", "request_date_ms": "1690438204330", "request_date_pst": "2023-07-26 23:10:04 America/Los_Angeles", "original_purchase_date": "2013-08-01 07:00:00 Etc/GMT", "original_purchase_date_ms": "1375340400000", "original_purchase_date_pst": "2013-08-01 00:00:00 America/Los_Angeles", "original_application_version": "1.0", "in_app": [ { "quantity": "1", "product_id": "gms.apple.gem_2990", "transaction_id": "2000000376851165", "original_transaction_id": "2000000376851165", "purchase_date": "2023-07-27 02:41:06 Etc/GMT", "purchase_date_ms": "1690425666000", "purchase_date_pst": "2023-07-26 19:41:06 America/Los_Angeles", "original_purchase_date": "2023-07-27 02:41:06 Etc/GMT", "original_purchase_date_ms": "1690425666000", "original_purchase_date_pst": "2023-07-26 19:41:06 America/Los_Angeles", "is_trial_period": "false", "in_app_ownership_type": "PURCHASED" } ] }, "environment": "Sandbox", "status": 0 } It looks like there was a successful purchase, I was expecting to see successful order information in signedTransactions, not empty. Any idea how to solve this please? Or my expectations are simply wrong, please correct me too thanks.
1
0
685
Jul ’23