StoreKit

RSS for tag

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

StoreKit Documentation

Post

Replies

Boosts

Views

Activity

StoreKit purchases not visible under "Manage Transactions..." in Xcode
I'm trying to test in-app purchases in my app in the sandbox environment. I've purchased a one-time purchase in the app, but no purchases are visible under "Manage Transactions..." in Xcode. Deleting the app from the device as well as deleting the directories ~/Library/Caches/com.apple.appstoreagent and ~/Library/Caches/com.apple.storekitagent does not remove the purchase from the app. This makes it impossible to fully test purchases in the app.
1
0
301
Aug ’24
offer code for auto-renew subscription
We would like to provide auto-renew subscription in our app and we have these questions: when provide offer codes for auto-renewable subscriptions using presentCodeRedemptionSheet() to let the user enter redeem code is it ok we put the redeem code in clipboard so that user just need to paste to enter ? we should present a screen that let user to choose which duration to subscribe, so that we can provide proper redeem code for user to use in system redeem sheet (call out by presentCodeRedemptionSheet()), am I right ? if user apply the redeem code, the system redeem sheet will emit the resulting transaction as if purchase the corresponding subscription by in-app purchase, am I right ? P.S. As we can't test redeem an offer code for an auto-renewable subscription in sandbox, so we don't know the exact flow of it and need to ask in forum.
4
0
282
Aug ’24
Regarding Subscription
I need some clarification from a functionality perspective. For example, in the application, a user can add a post and make it private. If anyone wants to view that post, they must pay an amount specified by the user when adding the post. This is the basic scenario. The main point of concern is price distribution. If the price of the post is $3.99, 10% of this amount goes to the app admin, and the remaining 90% goes to the user who posted the content, after accounting for Stripe's fees. My question is: We believe this functionality cannot be achieved using 'in-app purchases.' Need Assistance on this; whether scenario is achievable with 'in-app purchases'? If so, how can it be implemented?
0
0
235
Aug ’24
Unable to make a subscription in the sandbox environment.
Hi, I am not able to make any purchases in the sandbox environment and am getting the following error. Can someone please help me understand where the issue is? <SKPaymentQueue: 0x300d31ca0>: Payment completed with error: Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={client-environment-type=Sandbox, storefront-country-code=IND, NSUnderlyingError=0x300396ee0 {Error Domain=AMSErrorDomain Code=305 "Purchase Failed" UserInfo={NSLocalizedDescription=Purchase Failed, AMSURL=https://sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy?guid=00008030-001D282A2E42402E, AMSStatusCode=200, AMSServerPayload={ "cancel-purchase-batch" = 1; customerMessage = "Unable to process your request."; dialog = { defaultButton = ok; explanation = "Please try again later.\n\n[Environment: Sandbox]"; initialCheckboxValue = 1; isFree = 1; "m-allowed" = 0; message = "Unable to process your request."; okButtonString = OK; }; failureType = ""; "m-allowed" = 0; metrics = { actionUrl = "sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy"; asnState = 0; dialogId = "MZCommerce.SystemError"; eventType = dialog; message = "Unable to process your re"; mtEventTime = "2024-08-06 04:47:27 Etc/GMT"; mtTopic = "xp_its_main"; options = ( OK ); }; pings = ( "https://xp.apple.com/report/2/xp_its_main?code=MZCommerce.SystemError&buttons=OK&baseVersion=1&dsId=21818342290&eventVersion=1&storeFrontHeader=143467-2%2C29&eventTime=1722919664789&eventType=dialog&message=Unable%20to%20process%20your%20re" ); },
0
0
200
Aug ’24
Subscription Questions
I have accessed the third-party payment Qonversion, which has been uploaded to testflight, and some phenomena such as purchase failure or purchase waiting time out occurred when the customer used it The Qonversion developer replied that there were too many requests for this account and needed to change the account, is that right Do you need to change your account? How do you return the account? I want to know how testflight can correct the sandbox account instead of its own account
0
0
230
Aug ’24
Subscription problem
I have accessed the third-party payment Qonversion, which has been uploaded to testflight, and some phenomena such as purchase failure or purchase waiting time out occurred when the customer used it ​The Qonversion developer replied that there were too many requests for this account and needed to change the account, is that right ​Do you need to change your account? How do you return the account? I want to know how testflight can correct the sandbox account instead of its own account
0
0
256
Aug ’24
Issue with Offer Code Redemption: SKPaymentQueue Observer Not Notified in StoreKit
I'm developing an iOS app that supports in-app purchases and I'm using StoreKit2 for handling transactions. While purchase, promotion, and restore purchase functionalities are working fine, I'm facing an issue with offer code redemption. When I present the offer code redemption sheet using: ``SKPaymentQueue.default().presentCodeRedemptionSheet()`` I am able to redeem the offer code in App Store sheet. It's showing success. But after offer code redeem SKPaymentTransactionObserver does not seem to receive any updates or notifications. Specifically, the paymentQueue(_:updatedTransactions:) method is not being called. public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) import StoreKit `class YourClass: NSObject, SKPaymentTransactionObserver { override init() { super.init() SKPaymentQueue.default().add(self) } deinit { SKPaymentQueue.default().remove(self) } public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { for transaction in transactions { switch transaction.transactionState { case .purchased: print("Transaction Purchased") SKPaymentQueue.default().finishTransaction(transaction) case .failed: print("Transaction Failed") SKPaymentQueue.default().finishTransaction(transaction) case .restored: print("Transaction Restored") SKPaymentQueue.default().finishTransaction(transaction) case .deferred: print("Transaction Deferred") case .purchasing: print("Transaction Purchasing") @unknown default: print("Unknown Transaction State") } } } } ` So I am not able to update the UI and also not able to send the details to server. Steps I’ve Taken: Verified that the observer is added to the SKPaymentQueue in the initializer and removed in deinit. Tested on a real device, not just the simulator. Checked that the offer code is valid and properly set up in App Store Connect. Verified that the latest version of Xcode is being used. Questions: Is there a known issue with offer code redemption in StoreKit2 that might cause the observer not to receive notifications? Are there additional steps or configurations required to ensure that the transaction observer is notified about offer code redemptions? Are there any common pitfalls or troubleshooting tips for dealing with this issue? Any assistance or insights would be greatly appreciated!
0
0
310
Aug ’24
I have some questions about the values passed in StoreKit's applicationUsername and appAccountToken.
Hello, I am using StoreKit to provide in-app purchase functionality. To support devices running iOS 15 and below, I am using both StoreKit v1 and v2. I have some questions regarding the values for applicationUsername and appAccountToken. We are planning to convert a value used for user purchase verification into a UUID and pass this value as applicationUsername and appAccountToken. Since the UUID is not a fixed value like a user ID, a different value will be passed each time a purchase is made. We would like to know if there are any issues with passing a different value each time. Additionally, if anyone has experience using a dynamically changing value like a payload instead of a fixed user ID, we would appreciate it if you could share your insights. StoreKit (Original API) let payment = SKMutablePayment(product: product) payment.applicationUsername = uuid SKPaymentQueue.default().add(payment) StoreKit try await product.purchase( options: [ .appAccountToken(UUID(uuidString: uuid)!) ] ) The reason I'm asking these questions is because I came across a past document related to Detecting Irregular Activity: In the latest documents, this content is missing, so implementing it as described above seems to be fine. However, since the payment functionality is critical, I need to confirm. Past document What can I do to help combat fraud during purchase transactions? Recent documents requesting_a_payment_from_the_app_store applicationUsername For the original StoreKit API, there was content related to detecting irregular activity as mentioned above. However, for StoreKit v2, the appAccountToken does not seem to have such restrictions. Confirming this would greatly help in our service development. Thank you.
0
0
282
Aug ’24
How to properly use new StoreKit 2 views/modifiers/functionality for auto-renewable subscriptions
I would like to implement in-app auto-renewing subscriptions to open up "Pro" options for my app if a user chooses to subscribe. The user would be able to choose from a monthly or yearly subscription version. I have looked at hours and hours of countless videos, documents, tutorials, Apple examples (Backyard Birds, etc.), and posts on all of this but I'm still not sure that I understand the correct way to do this via the "new" StoreKit 2 framework additions. From various WWDC videos, it would seem that it's now as simple as using SubscriptionStoreView and then utilizing the modifiers .onInAppPurchaseCompletion, .subscriptionStatusTask, and .manageSubscriptionsSheet. It sounded to me like everything, including purchases and verifying transactions, is handled automatically for auto-renewing subscriptions. When testing my app, I can bring up my store view with no problem and make purchases with the simulator. That being said however, I am finding it fairly difficult to understand exactly what I need to do in order to make this all work correctly. The following are questions that I need answered in order to proceed: For in-app auto renewable subscriptions, should we just be using: SubscriptionStoreView, .onInAppPurchaseCompletion, .subscriptionStatusTask, and .manageSubscriptionSheet? Does .subscriptionStatusTask automatically and continually check for subscription status changes so that views dependent on that status will know whether or not a user has a valid subscription? Do I also need to set up a task when opening my app that checks for current entitlements? Do I still need to explicitly verify transactions or devices? What is supposed to happen with the logic flow? Is it suppose to be: Check to see if user EVER had a subscription... ---- if NOT -> present the paywall/store ---- else -> present the manageSubscriptionSheet Note: When I've tested variations of this, if the user didn't have a previous subscription at some point, the manageSubscriptionSheet will not be presented. It just "clocks" with a blank screen. Sorry for so many questions. I submitted a code-level support request to get help with this but the email I received back said to just post in the forum. I'm hoping someone here can help. I have other questions also but I'll make a separate post for them. TIA.
0
0
384
Aug ’24
Validating receipts on the device
hi everyone i am having a little problem with setting up my payment with subscriptstion method Problem 1 i have set up Agreements tax and Banking for my apple connect account to get productID from apple connect that i have set up but it is Missing Tax Info is this necessary to set up to be able to get productID does setting up banking and agreement in process affect me setting up tax info Problem 2 when i test with StoreKit 2 environment i am having problem when reading the instruction document how to Validating receipts on the device i have done to step 2 decode recieptData but don't know how to continue using the Apple Inc. Root certificate file apple document:https://developer.apple.com/documentation/appstorereceipts/validating_receipts_on_the_device Thanks everyone
1
0
378
Aug ’24
Apple In App Purchase for dynamic products
I'm developing a multi-platform e-learning app in React Native where teachers create courses by uploading various types of content, such as videos, PDFs, Zoom meeting links, or simply by chatting with students. Students can purchase these courses via the app. However, our app has been repeatedly rejected by the App Store because digital content for mobile must be purchased through the App Store. This presents a challenge since the content our teachers upload is dynamic and varied, making it impractical to predefine all possible subscription packages. From my understanding, subscriptions or products need to be created in our App Store account first, and only then can they be fetched in our app. Is there a way for Apple to support dynamic subscription packages that can be uploaded through the app ? Any guidance on how to manage this within the App Store guidelines would be greatly appreciated.
0
0
264
Jul ’24
Apple In app Purchase for dynamic products
I'm developing a multi-platform e-learning app in React Native where teachers create courses by uploading various types of content, such as videos, PDFs, Zoom meeting links, or simply by chatting with students. Students can purchase these courses via the app. However, our app has been repeatedly rejected by the App Store because digital content for mobile must be purchased through the App Store. This presents a challenge since the content our teachers upload is dynamic and varied, making it impractical to predefine all possible subscription packages. From my understanding, subscriptions or products need to be created in our App Store account first, and only then can they be fetched in our app. Is there a way for Apple to support dynamic subscription packages that can be uploaded through the app, Any guidance on how to manage this within the App Store guidelines would be greatly appreciated.
0
0
292
Jul ’24
auto-renew subscription on introductory offers and offer code
We would like to provide auto-renew subscription in our app and we have these questions: when provide introductory offers: Free Trial for auto-renewable subscriptions, is user no need to pay if choose to stop the auto-renew during free trial period ? when provide offer codes for auto-renewable subscriptions using presentCodeRedemptionSheet() to let the user enter redeem code is it ok we put the redeem code in clipboard so that user just need to paste to enter ? seems the system redeem sheet will emit the resulting transaction as if purchase the corresponding subscription in-app purchase in case user apply the redeem code, am I right ? seems the system redeem sheet won't show the offer details e.g. discounted price and original price in case the offer is pay up front, so does it means our app should present these details before present the system redeem sheet ?
2
0
317
Jul ’24
SubscriptionStoreView not displaying subscriptions in distributed app
Hello, My app has been published and distributed on the App Store on 2024/07/24. There are four available subscriptions from within the app, belonging to the same subscription group. All four subscriptions are approved. To display the subscriptions to the users, I use the SubscriptionStoreView(groupID: String) view provided by StoreKit 2. The groupID used in my app is the same as in App Store Connect. My app has the in-app purchase capability. Everything worked perfectly during the development phase, and the team in charge of reviewing subscriptions on Apple’s side managed to view the storefront with all four subscriptions. No new build has been submitted since 2024/07/24. However, when accessing the storefront (i.e. when the SubscriptionStoreView is displayed) from the distributed app in the App Store, subscriptions are not properly shown. As per the screenshots: On 2024/07/26 @ 01:56 PM (GMT+2), there were two available subscriptions out of four when opening the store front from my iPad, and one available subscription on my iPhone, On 2024/07/26 in the afternoon, all four subscriptions were available (iPhone & iPad), but I didn’t take screenshots thinking the issue was solved…, On 2024/07/26 @ 06:25 PM, there were no available subscriptions anymore (checked on my iPhone: “Subscription Unavailable - The subscription is unavailable in the current storefront”) On 2024/07/26 @ 08:54 PM, there was a single available subscription (iPhone) On 2024/07/27 @ 08:54 AM, there were three available subscriptions (iPhone), On 2024/07/27 @ 09:43 AM, there were no available subscriptions anymore (iPhone), As of now, there still isn’t any available subscription anymore (iPhone + iPad)… I have submitted two cases to Apple Support: The first one on 2024/07/25 around 06:12 PM (GMT+2), The second one on 2024/07/26 around 06:53 PM (GMT+2), referencing the first one. No answer as of today. Because of this issue which seems to impact many other developers: I cannot communicate about the app, You cannot mend a first impression; users interested by the app who stumble across cannot subscribe, and will most likely consider the app to have some bugs, meaning they might lose trust because of an issue on which we cannot even intervene. To put it in a nutshell, this issue is seriously hindering the launching phase of the app. What is a temporary but quick solution that those of you who have (had) the same issue put in place? Is there any official answer regarding this issue? Regards, Ibi
5
2
848
Jul ’24
In-App Purchase works in TestFlight but not after Distribution
Good Day, This is my first app with In-App Purchase (IAP) for three simple consumable products. Ad For 1 Month, 2 Months and 3 Months. It works fine in Xcode and in TestFlight. App was approved and was automatically placed in App Store for distribution on July 25 morning. App publishes user's first ad free, by-passing StoreKit. but 2nd Ad onwards goes thru IAP. App works fine except screen with 3 consumable products/prices is not being displayed. Means IAP is not available in the distributed App whereas it all works fine in TestFlight. I googled, checked documents, asked chatGPT and submitted a question to Support (waiting for response). I don't know what I am missing. I read that it takes a day or two for IAP to work in App Store. Will appreciate any help. Thanks.
5
0
459
Jul ’24
APP Store Server Notifications Unrelated transactions info for auto-renewable subscription
Greetings for App Store Server Notifications especially sandbox (I have not tried production) it seems that that is no way to associate two transactions to their orignal subscription instance the docs indicate webLineItemOrderId id but they are different from each subscription the originalTransactionId is the same among all subscription instances and customers, theres originalPurchaseDate but that is not reliable becuase 2 transactions can occur on the same date what can be done here. I even tried to use it but its like the sandbox is broken with the originalPurchaseDate of one instance being the same as another. is it a bug or will things get in line once I go to production?
1
0
293
Jul ’24
In-app purchases products for marketplace items
We are programming a marketplace for digital artwork, which shall use in-app purchases. Are we allowed/supposed to create only one storekit product, which we can call "item-x" and assign a fix price of i. e. 5,00$, assuming all items are sold for 5,00$, and use this product for all items? Or shall we create one product for each item which is selled on or platform, which could be 1.000?
0
0
342
Jul ’24