StoreKit

RSS for tag

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

StoreKit Documentation

Post

Replies

Boosts

Views

Activity

No way to close the page for subscription Offer Code processing invoked by "SKPaymentQueue.default().presentCodeRedemptionSheet()".
Problem was observed on the published App because the IAP offer code processing is only done on the published App. I implemented the ".presentCodeRedemptionSheet()" command by tapping Offer Code button. Then the typed in offer code was processed by this page and the offer was successfully purchased from AppStore. After detecting the purchased status, executed "SKPaymentQueue.default().finishTransaction(transaction)". I thought that finishTransaction() would close the offer code processing page that is not written in document. However the page for offer code processing page was still displayed and was never closed. The only way to close the input page for offer code is to manually tapping "Cancel" button. Since there is no way to close the offer code processing page, I added ".popToRootViewController(animated: true)" in order to close all pages and views after detection of purchased status but failed to close the offer code processing page managed by Apple. I need to know how to programmatically close the offer code processing page invoked by ".presentCodeRedemptionSheet()". I got no response from FeedBackAssistant and Apple Developer Technical Support. Thank you.
4
0
568
Apr ’23
Transaction fails with ASDServerErrorDomain Code=3504 in production
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?
11
5
2.6k
Apr ’23
Can I use AppTransaction to verify purchase of a paid macOS app?
I've tried to use AppTransaction.shared / AppTransaction.refresh() to verify that my app has been purchased from the Mac App Store. It works when testing a release build on my Mac, using a Sandbox Apple ID. But when I submit the app for review, the reviewer says it doesn't work. The error message returned by AppTransaction is "Unable to Complete Request", which is pretty vague. I get the same error when I try to use a real Apple ID for testing on my machine, so I have been wondering if maybe the problem is that App Review is testing a build that doesn't accept Sandbox Apple IDs? My app doesn't have a provisioning profile, could it be that this is the problem? As a Mac app developer, I'm not sure what provisioning profiles are good for, I thought they were only useful for iOS. Has anybody successfully submitted a Mac app that uses AppTransaction?
4
3
914
Apr ’23
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
2.2k
Apr ’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.7k
May ’23
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
930
May ’23
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!
5
1
1.6k
Jun ’23
Your payments from Apple are on hold.
Hey everybody, today I received an email (seemingly automated) stating that my payment is on hold due to irregular activity. However, I haven't violated any rules, and I've seen that many other people have received the same message. As soon as I saw the email, I contacted support via phone, and the representative who assisted me confirmed that my account status is correct and in good standing. She requested that I forward the email to her for further investigation. Email received: "We noticed some irregular activity associated with your vendor number XXXXXXXX and have paused your earnings payments while we investigate. Once our review is complete, we'll determine if we can resume your payments." Questions: Has anyone else experienced this issue? If so, what was the process to resolve it? How long does it typically take to have the payments resumed? Wishing you all a great day, Thank you.
4
2
1.7k
Jul ’23
Is wallet extension an mandatory implementation for Apple Pay and Add to wallet?
I am working on a banking application (includes iPhone and iPad) which includes add to wallet feature. During the implementation I saw one document it is mentioned that for iPad app, the app must be extended to support Apple pay functionality. Details from document says "Card Issuers with an iOS mobile banking app must support Card Issuer iOS Wallet extension functionality to enable Card issuer mobile app customers to provision new cards directly from the iOS Wallet app with all eligible Apple iOS devices. If the Card Issuer has a dedicated iPad App, that App must be extended to support Apple Pay functionality. " Is wallet extension implementation required for Apple pay to work in iPhone and iPad? Is wallet extension a mandatory implementation for Add to Apple Wallet feature to work and approved by Apple? I am little confused in this. Anyone who integrated Apple pay or done add to Apple Wallet feature recently without wallet extension faced any rejection? Any help would be much appreciated.
3
1
2.9k
Aug ’23
How to decode signedTransactionInfo after GET request?
Hello! Please let me know after I make a request for purchase information GET https://api.storekit-sandbox.itunes.apple.com/inApps/v1/transactions/2000000411047647 I receive encrypted information in this format { "signedTransactionInfo":"eyJhbGciOiJFUzI1NiIsIng1YyI6WyJNSUlFTURDQ0E3YWdBd0lCQWdJUWZUbGZkMGZOdkZXdnpDMVlJQU5zWGpBS0JnZ3Foa2pPUFFRREF6QjFNVVF3UWdZRFZRUURERHRCY0hCc1pTQlhiM0pzWkhkcFpHVWdSR1YyWld4dmNHVnlJRkpsYkdGMGFXOXVjeUJEWlhKMGFXWnBZMkYwYVc5dUlFRjFkR2h2Y21sMGVURUxNQWtHQTFVRUN3d0NSell4RXpBUkJnTlZCQW9NQ2tGd2NHeGxJRWx1WXk0eEN6QUpCZ05WQkFZVEFsVlRNQjRYRFRJek1Ea3hNakU1TlRFMU0xb1hEVEkxTVRBeE1URTVOVEUxTWxvd2daSXhRREErQmdOVkJBTU1OMUJ5YjJRZ1JVTkRJRTFoWXlCQmNIQWdVM1J2Y21VZ1lXNWtJR2xVZFc1bGN5QlRkRzl5WlNCU1pXTmxhWEIwSUZOcFoyNXBibWN4TERBcUJnTlZCQXNNSTBGd2NHeGxJRmR2Y214a2QybpBQmhpVm9kSFJ3T2k4dmIyTnpjQzVoY0hCc1pTNWpiMjB2YjJOemNEQXpMWGQzWkhKbk5qQXlNSUlCSGdZRFZSMGdCSUlCRlRDQ0FSRXdnZ0VOQmdvcWhraUc5Mk5rQlFZQk1JSCtNSUhEQmdnckJnRUZCUWNDQWpDQnRneUJzMUpsYkdsaGJtTmxJRzl1SUhSb2FYTWdZMlZ5ZEdsbWFXTmhkR1VnWW5rZ1lXNTVJSEJoY25SNUlHRnpjM1Z0WlhNZ1lXTmpaWEIwWVc1alpTQnZaaUIwYUdVZ2RHaGxiaUJoY0hCc2FXTmhZbXhsSUhOMFlXNWtZWEprSUhSbGNtMXpJR0Z1WkNCamIyNWthWFJwYjI1eklHOW1JSFZ6WlN3Z1kyVnlkR2xtYVdOaGRHVWdjRzlzYVdONUlHRnVaQ0JqWlhKMGFXWnBZMkYwYVc5dUlIQnlZV04wYVdObElITjBZWFJsYldWdWRITXVNRFlHQ0NzR0FRVUZCd0lCRmlwb2RIUndPaTh2ZDNkM0xtRndjR3hsTG1OdmJTOWpaWEowYVdacFkyRjBaV0YxZEdodmNtbDBlUzh3SFFZRFZSME9CQllFRkFNczhQanM2VmhXR1FsekUyWk9FK0dYNE9vL01BNEdBMVVkRHdFQi93UUVBd0lIZ0RBUUJnb3Foa2lHOTJOa0Jnc0JCQUlGQURBS0JnZ3Foa2pPUFFRREF3Tm9BREJsQWpFQTh5Uk5kc2twNTA2REZkUExnaExMSndBdjVKOGhCR0xhSThERXhkY1BYK2FCS2pqTzhlVW85S3BmcGNOWVVZNVlBakFQWG1NWEVaTCtRMDJhZHJtbXNoTnh6M05uS20rb3VRd1U3dkJUbjBMdmxNN3ZwczJZc2xWVGFtUllMNGFTczVrPSIsIk1JSURGakNDQXB5Z0F3SUJBZ0lVSXNHaFJ3cDBjMm52VTRZU3ljYWZQVGp6Yk5jd0NnWUlLb1pJemowRUF3TXdaekViTUJrR0ExVRWUVFERER0QmNIQnNaU0JYYjNKc1pIZHBaR1VnUkdWMlpXeHZjR1Z5SUZKbGJHRj000OUJBTURBMmdBTUdVQ01RQ0Q2Y0hFRmw0YVhUUVkyZTN2OUd3T0FFWkx1***5UmhIRkQvM21lb3locG12T3dnUFVuUFdUeG5TNGF0K3FJeFVDTUcxbWloREsxQ" } Please tell me how I can decode the information signedTransactionInfo ? and what is needed for this? (I'm trying to decode on Node.js)
4
0
3.1k
Sep ’23
Offer Codes cannot be redeemed
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.
4
1
1.4k
Sep ’23
StoreKit 2: cancellation button
I have auto-renewable subscriptions in my app. I've been using .manageSubscriptionsSheet to present a user with a variety of subscriptions and a possibility to cancel the current subscription. Now, I'm trying out the new StoreKit 2 (available in iOS 17.0+) - and it works great (and also looks nice), but it doesn't seem to support cancellation... I tried different options and couldn't make it show anything related to "unsubscribing". One of the options I've tried was adding .storeButton(.visible, for: .cancellation) - but it doesn't seem to do anything. So the question is: is it not possible to let users unsubscribe from within the app with StoreKit 2? And if so, what's the recommended approach?
4
0
2.1k
Sep ’23
Subscription downgrade renewal in sandbox
Hi, I am testing auto-renew subscriptin in the sandbox. If I purchase a subscription to Level 2, it renews every few minutes and I get notification in BE. All good. But if, before it expires I do a downgrade to Level 1 in my app, the following happens. The Level 2 subscription continues until it expires. the latest receipt is saying the original subscription has expired. It does include the new subscription in the "auto_renew_product_id" field, but in that field the "auto_renew_status" is set to 0, expiration_intent is set to 0, and not data for Level 1 subscription in field latest_receipt_info, And my app is show this account is no plan with it. I'm make sure I don't cancel any subscription manually. "environment": "Sandbox", "receipt": { "receipt_type": "ProductionSandbox", "adam_id": 0, "app_item_id": 0, "bundle_id": "xxxxxxxxxx", "application_version": "6", "download_id": 0, "version_external_identifier": 0, "receipt_creation_date": "2023-09-28 06:22:18 Etc/GMT", "receipt_creation_date_ms": "1695882138000", "receipt_creation_date_pst": "2023-09-27 23:22:18 America/Los_Angeles", "request_date": "2023-09-28 06:22:44 Etc/GMT", "request_date_ms": "1695882164902", "request_date_pst": "2023-09-27 23:22:44 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": "level2", "transaction_id": "2000000422878353", "original_transaction_id": "2000000421925037", "purchase_date": "2023-09-27 04:35:19 Etc/GMT", "purchase_date_ms": "1695789319000", "purchase_date_pst": "2023-09-26 21:35:19 America/Los_Angeles", "original_purchase_date": "2023-09-26 06:17:05 Etc/GMT", "original_purchase_date_ms": "1695709025000", "original_purchase_date_pst": "2023-09-25 23:17:05 America/Los_Angeles", "expires_date": "2023-09-27 05:11:19 Etc/GMT", "expires_date_ms": "1695791479000", "expires_date_pst": "2023-09-26 22:11:19 America/Los_Angeles", "web_order_line_item_id": "2000000037933985", "is_trial_period": "false", "is_in_intro_offer_period": "false", "in_app_ownership_type": "PURCHASED" }], "latest_receipt_info": [ { "quantity": "1", "product_id": "level2", "transaction_id": "2000000423805961", "original_transaction_id": "2000000421925037", "purchase_date": "2023-09-28 04:21:58 Etc/GMT", "purchase_date_ms": "1695874918000", "purchase_date_pst": "2023-09-27 21:21:58 America/Los_Angeles", "original_purchase_date": "2023-09-26 06:17:05 Etc/GMT", "original_purchase_date_ms": "1695709025000", "original_purchase_date_pst": "2023-09-25 23:17:05 America/Los_Angeles", "expires_date": "2023-09-28 04:57:58 Etc/GMT", "expires_date_ms": "1695877078000", "expires_date_pst": "2023-09-27 21:57:58 America/Los_Angeles", "web_order_line_item_id": "2000000038038221", "is_trial_period": "false", "is_in_intro_offer_period": "false", "in_app_ownership_type": "PURCHASED", "subscription_group_identifier": "20412672", "app_account_token": "664bf8a5-3586-4e81-9a48-d31dd096e0eb" }], "latest_receipt": "xxxxxxx", "pending_renewal_info": [ { "expiration_intent": "1", "auto_renew_product_id": "level1", "is_in_billing_retry_period": "0", "product_id": "level2", "original_transaction_id": "2000000421925037", "auto_renew_status": "0" } ], "status": 0
1
0
424
Sep ’23
How to Retrieve the Previous Price of an AutoRenewable Subscription Product in StoreKit2?
Hi, Recently, I have changed the price of an auto-renewable subscription. At that time, I made sure that existing subscribers maintain the previous price. The issue is that product.displayPrice in StoreKit2 returns the new price even for those users who were able to maintain the old price. Is there a way to retrieve the previous (actually applied to the user) price using StoreKit2? Thank you.
1
0
613
Sep ’23
Transaction.updates emits a transaction while purchasing on the same device through product.purchase()
Hi everyone, I'm facing a weird behaviour when purchasing an auto-renewable subscription in the sandbox environment on a real device with purchase(options:) and also listening to Transaction.updates. I get the "You're all set. Your purchase was successful [Environment Sandbox]" alert. I receive an update through Transaction.updates. and also a transaction from Product.PurchaseResult. Both transactions are successfully verified and have the same transactionId. Both have PURCHASE as transactionReason. They only differ in: deviceVerification deviceVerificationNonce originalPurchaseDate signedDate I was not expecting to receive an update through Transaction.updates as the purchase was done on the same device. As the documentation says, Transaction.updates emits a transaction when the system creates or updates transactions that occur outside of the app or on other devices. Am I losing something? Thanks for your help!
2
1
794
Oct ’23
Transaction state gets `.purchased` even I set `SKTestSession.askToBuyEnabled = true`
I was trying to write unit test of ask to buy for SKDemo app. Even if I set SKTestSession.askToBuyEnabled = true, I got transaction state as .purchased after I call SKTestSession.buyProduct(identifier:). import StoreKitTest import XCTest final class SKDemoTests: XCTestCase { private var session: SKTestSession! override func setUp() async throws { session = try .init(SKTestSession(configurationFileNamed: "Products")) session.disableDialogs = true session.resetToDefaultState() session.clearTransactions() } func test() async throws { session.askToBuyEnabled = true try await session.buyProduct(identifier: "consumable.fuel.octane89") XCTAssertEqual(session.allTransactions().first!.state, .deferred) // Gets error here. The actual state I get is .purchased } } I was using Xcode 15.0.1 (15A507), Simulator iPhone 15 Pro iOS 17.0.1 (21A342) I couldn't find the problem so I'm happy to hear any solutions.
2
1
611
Oct ’23
StoreKit 2 - AppTransaction.originalAppVersion confusion
I've watched some of the WWDC session videos about this topic and read the documentation and header files, but it is still confusing... Because I change the pricing model of my iOS App (it was a paid App and now it will be a free App with an In-App purchase), I want to check if a user of my App purchased the App in the past. So user who have already paid in the past will get the full access without the need to pay the IAP, while new users would have to do this. In one of the WWDC videos exactly this topic was covered and the solution would be to check out AppTransaction.originalAppVersion. This would be a simple and easy solution... ...Unless I read the information from the header file and documentation for this API. Here it says: The string value contains the original value of the CFBundleShortVersionString for apps running in macOS, and the original value of the CFBundleVersion for apps running on all other platforms. The problem here is that when I check the Info.plist of iOS Apps, the CFBundleShortVersionString is used for the main App version and CFBundleVersion is used for the "build" number. According to the cited documentation from above, AppTransaction.originalAppVersion would be totally uselesss on the iOS platform, because it would only return the build number and not the version number. So I'm confused. Can I use AppTransaction.originalAppVersion to get the original version that was purchased for iOS Apps? If yes, the documentation must be wrong and misleading. If no, how can I do this? I'm currently in testing and I only get "1.0" as originalAppVersion within the beta release. This could be either because I really only get the useless build number, or I get the "real" version because the App is on the device since version "1.0" on my device, or it is just a limitation of XCode while testing that it is returning version "1.0" but would return the correct version when the App was installed from the AppStore.... Can someone bring some light into this topic? Am I missing something or did I understand something wrong?
2
4
959
Nov ’23
Introductory offer does not appear for Sandbox testing
Hi, I currently have an introductory offer set up in App Store Connect, which is in the 'Ready to Submit' state. When testing with the StoreKit configuration testing for Xcode, the introductory offer appears correctly, and I can successfully make and cancel purchases. However, when testing on a device without the StoreKit configuration, using a new sandbox account, the introductory offer does not appear, though the introductory price is visible for subscription. Could you advise on how to ensure the introductory offer is displayed in this scenario? Using Storekit 2
2
0
846
Nov ’23
In App Purchases Not Completing
Looks like I'm getting the error "There's no information available for in app purchases. Try again later. 21102" The purchase starts, gets to in progress but never completes so I cannot grant the user any item in app. App info: I made a small test application with a simple purchase button and restore purchase button, the middle button as shown in the video that's clicked is the purchase button to kick off the transaction. If the service isn't working through the manage>test purchase in appstore>sandbox(not in-app), it is likely not a code issue from my end, it is either internally from your Apple side or a config issue on the apple account application end on my side. Ive tried deleting sandbox testers, new builds, as well as doing it on test flight. Just feel like if its not workig through manage>test purchase in appstore>sandbox then its def not a my problem Logs: <SKPaymentQueue: 0x281f4eb40>: Payment completed with error: Error Domain=ASDServerErrorDomain Code=3539 "There’s no information available for In‑App Purchases. Try again later." UserInfo={NSLocalizedFailureReason=There’s no information available for In‑App Purchases. Try again later., AMSServerErrorCode=3539, client-environment-type=Sandbox, storefront-country-code=USA} Any help would be great, this has been happening for a week now , and apple has been 0 help. Thank you so much for anything here.
18
2
3k
Nov ’23