StoreKit

RSS for tag

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

StoreKit Documentation

Post

Replies

Boosts

Views

Activity

Test Flight build does not show Purchase Confirmation popup for IAP.
Hi, We are seeing a small issue on our app with a subscription in app purchase and wondering whether this should be a cause for concern. We have 2 subscription based IAPs and 1 consumable within the app. I recently noticed that after buying one of the subscriptions and cancelling it if I try to buy the product again, it skips the purchase flow on our Test Flight builds. I added some logs, and it appears that Product.purchase() returns right away and the resulting transaction also comes back as verified, but the new purchase is not added to current entitlements. I managed to get the flow working after I logged out from my Sandbox account from settings, but after I did another subscription cancellation, I could not purchase the product anymore. This only happens on our Test Flight builds. If I launch the app through Xcode and use a store kit configuration file at launch, I get the purchase popup every time I try to buy the product. It also appears to me that this only happens on a product that I have purchased previously. For the other subscription that I have not purchased before the popup shows up every time. Is this something that we should be concerned about and is there a way to make sure the purchase popup shows up every time? Thank you. Kind regards, Fardin
0
0
291
Jul ’24
Clarification on Offering Non-Consumable In-App Purchases for Subscribers Only
Hello everyone, I have an iOS application that includes subscription-based content. I would like to offer two non-consumable in-app purchases that unlock additional features, but only for users who have an active subscription. Here’s a detailed description of my plan: Subscription Requirement: Users need to have an active subscription to be able to purchase these non-consumable items. Feature Unlocks: These non-consumable purchases will unlock specific features usable forever as long as the user has an active subscription (even if he unsubscribes and re-subscribes, he will not have to reacquire these features). My questions are: Is it compliant with Apple’s App Store guidelines to offer non-consumable in-app purchases that are available only to subscribers? Are there specific considerations or best practices I should follow to ensure a smooth review process with Apple? I want to make sure that I implement this correctly and transparently for my users while staying compliant with Apple’s policies. Any guidance or shared experiences would be greatly appreciated. Thank you!
0
0
226
Jul ’24
[StoreKit2] Purchase completion is displayed even if it has not been completed.
StoreKit2 is being tested in a Sandbox environment for the purchase of consumable items. The code being implemented is below. let result = try? await product.purchase() switch result { case let .success(verification): switch verification { case let .verified(transaction): let jws = verification.jwsRepresentation let success = await purchaseItem(of: itemId, with: jws) if success { await transaction.finish() return (success: true, error: nil) } else { return (success: false, error: .serverError) } case .unverified: return (success: false, error: .unverified) } Assume that the verification was successful, but a server error occurred. in let success = await purchaseItem(of: itemId, with: jws), success = false When tested in Sandbox and local environment, the first alert of purchase completion is displayed. After that, a purchase failure alert is displayed. (The purchase failure alert is displayed by the result of return (success: false, error: .serverError)) Is it proper behavior to display purchase completion once? Is it appropriate behavior for the purchase completion to be displayed once in the production environment? Is the billing actually occurring at this time? Thank you in advance for your answers!
1
0
363
Jul ’24
Error Domain=SKErrorDomain Code=0 "An unknown error occurred"
Hello everyone, I am trying to implementing the In-App Purchase in one of my iOS App and I am getting the following error when I test it into iPhone, but when I test the same app into the iPad I didn't get any error and it works properly. Error Domain=SKErrorDomain Code=0 "An unknown error occurred" UserInfo={NSLocalizedDescription=An unknown error occurred, NSUnderlyingError=0x282da9860 {Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={NSUnderlyingError=0x282d02940 {Error Domain=AMSErrorDomain Code=203 "Bag Load Failed" UserInfo={NSLocalizedFailureReason=Unable to retrieve p2-product-offers-batch-limit because we failed to load the bag., NSLocalizedDescription=Bag Load Failed, NSUnderlyingError=0x282d02af0 {Error Domain=AMSErrorDomain Code=203 "Bag Load Failed" UserInfo=0x2836ca380 (not displayed)}}}}}}
1
0
493
Jul ’24
Server Side validation for In-App Purchase
Hi, Our application offers 3 non-renewing subscriptions. I have integrated the necessary code, and our App Store Account Paid Agreement status is Active. Transactions are successfully completed in the sandbox environment. However, I am facing difficulties with server-side validation. The /verifyReceipt API is deprecated, and I need an alternative method for server-side validation. The Apple documentation is quite confusing, and I couldn't find any articles related to the new approach for server-side validation. I would greatly appreciate it if you could provide a detailed guide on how to perform server-side validation with the new method. Thank you in advance.
1
0
582
Jul ’24
storekit configuration file Only for testing ?
I was using the storekit configuration file to test subscriptio renewals so set it to renew every 30 seconds. I have since shipped the App. Should I have set the storekit configuration file back to real time for the renewals, or the storekit configuration file is only for non release builds so anything I have changed in their won’t effect the released build ?
1
0
376
Jun ’24
Auto-renewing Subscription Updates not Arriving
This is a copy of a reply to this post. https://developer.apple.com/forums/thread/722222?page=1 I'm posting as new in the hope someone might have more up-to-date information, as I'm pulling out what little hair I have left. I'm using Storekit 2, testing in Xcode with a local Storekit config file. I have created a very minimal system to investigate this issue. I have a SwiftUI-based window using SubscriptionStoreView, and my app set up with the usual listener. I have four types of auto renewing subscription, configured in the local Storekit config file. With my app running, I subscribe to the lowest-level subscription I offer, via the SubscriptionStoreView. Notification of the inital purchase arrives, but subsequent auto-renewals do not trigger any action in my listener for Transaction.updates. They arrive as expected in the Transaction Manager. Radio silence in my listener. If I upgrade one subscription (via my SubscriptionStoreView) I see this reflected in the UI immediately, and also in the Transaction Manager, but the update that arrives in Transaction.updates refers to the old subscription, and has the isUpgraded flag set to false. Also, can anyone remind me what the grey warning triangle next to entries in the Transaction Manager means. I'm assuming it means unfinished, as that's what the sidebar indicates. Can the testing system really be this broken, or am I wildly off the mark? Unless I'm doing something fundamentally wrong this all seems extremely flakey, but happy to be proved wrong. I find this all rather unsettling if I can't test reliably, and am concerned that I my app may end up in this situation if I use storekit 2: https://stackoverflow.com/questions/73530849/storekit-renewal-transactions-missing-in-transaction-all-or-transaction-updates
7
1
1.1k
Jun ’24
App Store Server API: > 4 second latency
We're currrently migrating from the deprecated /verifyReceipt endpoint to the new App Store Server API. Context: We use Storekit 2 on the client. Even though it validates transactions client-side, our app also persists subscription data (Original Transaction ID + Product ID) to our DB, so it's necessary to validate the purchases server-side as well. When calling the new endpoints (for example, Get All Subscription Statuses or Get Transaction History ), I'm currently seeing 4+ second latency. This is the case when passing in only a Transaction ID and hitting the Production endpoint, even for Transaction IDs that don't exist in Production (eg, Sandbox transactions). Are there any plans to improve the performance of this API? As it currently stands, we're holding off on the migration -- 4 seconds is far too impactful on both our user experience and our backend system versus the existing 300-400ms latency of /verifyReceipt.
3
0
403
Jun ’24
Identifying users using app in different platforms (iOS and macOS) and different bundle ids
I am trying to grant access to users that subscribe to premium on the iOS app also to users that use the macOS version. The iOS and macOS version are two separate apps with different BundleIDs, same Team ID. I can't create a App bundle because they are part of different platforms. I know that I could ask the user for a login so I could recognize the user from the authentication, but I would like to avoid this step. Is there any ID i can use to identify users between different platforms?
1
0
412
Jun ’24
using external link for payment than In-App purchase
We are a small startup and in process of launching our product. For now we have digital services (user can add and see data as they entered only be subscribed), but later we would have value added services - including hardware ( devices e.g. Glucometer). Current payment workflow we have uses Razorpay as payment gateway. We have two options: We can either make a web page for the payments to be collected via Razorpay. this will have less impact on the code and implementation. (like there's for Netflix and Spotify where they redirect to browser for payment than in-app purchase) We can add the apple payment gateway for the payments. Questions: What would be the charges in both the scenarios ? E.g. If we take 100rs payment from patient then how much would go to apple in scenario 1 and 2. Is there any support for small startups where apple provides some discount with respect to the payments collected ?
0
0
236
Jun ’24
StoreKit issue
Hey everyone! I’m currently working on a new app called Kept – a simple and elegant journaling app designed to help you capture your thoughts and ideas effortlessly. However, I’ve hit a bit of a snag with the TestFlight distribution of the app. When I test the in-app purchases locally, everything works perfectly. But once the app is pushed to TestFlight, users only see "Loading products..." indefinitely and are unable to make purchases. Here are the details: The app works locally with sandbox accounts. Product identifiers and configurations have been double-checked. All in-app purchases are correctly set up and approved in App Store Connect. Using correct sandbox account settings on the device.
1
0
523
Jun ’24
Are there cases where a response to an error returned from the AppStore Server API is considered a subscription cancellation by the user?
According to the following document, when the AppStore Server API is executed and the account does not exist, the response "errorCode: 4040001" is returned. If this response is returned, is it safe to assume that the account has been deleted and treat the subscription as cancelled? Also, please let us know if there are any other error codes other than this error code that can be used to determine that the subscription has been cancelled. https://developer.apple.com/documentation/appstoreserverapi/accountnotfounderror
1
0
466
Jun ’24
When I will receive the App Store Server notification?
I'm migrating my app to Store Kit V1, to Store Kit V2, and, due some legacy circumstances I'm implemented in past using a synchronous method, calling verify receipt on my server to validate receipt and do the needed business logic, but due to the deadline I changed the entire app integration and some questions starting to appear in my mind. First of all, when I processing the purchase when basically I will receive the notification? When the Store Kit calls the transaction.finish or after the purchase was successful I always will receive this notification?
1
0
499
Jun ’24
In-App purchase required for a support app?
Hi, I am trying to determine if an in-app purchase will be required within the app we are developing. We provide a web platform where the user can sign in and offer/search services correlated to entertainment world (showman, catering, DJ, live food lesson, etc.). The web app has 2 target: consumer users and business user. Consumer users can search services that tay want and chat business users owner of that services. Business users can create their ownpages in order to be visible to the consumer users in the community. Business users can also access too specified premium features for visibility. We are now designing a mobile app with only few features: Register login section Search business pages The users are the same and there is no differences in the mobile features (no hide premium functionalities). For these small features we have to implement the in-app purchase? The idea is to provide initially a small "companion" app to search business pages. Fo the next releases, where we want to provide more features, premium functionalities for business user we will integrate in-app and we already have plans to implement it. Thanks in advance!
0
0
292
Jun ’24