StoreKit

RSS for tag

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

StoreKit Documentation

Posts under StoreKit tag

344 Posts
Sort by:
Post not yet marked as solved
0 Replies
9 Views
Hey everyone, I'm facing a bit of a puzzling issue with the review of my app, particularly with the in-app purchase functionality for message extension/sticker packs. I've implemented the entire store using StoreKit for in-app purchases, using exactly the same code like it is in Apple's demo application (https://developer.apple.com/documentation/storekit/in-app_purchase/implementing_a_store_in_your_app_using_the_storekit_api). Here's the problem: the products appear correctly according to what's set up in App Store Connect (In-App Purchases section), and the purchase process works flawlessly in sandbox and TestFlight environments. However, during the review process, I received the following feedback: "Guideline 2.1 - Performance - App Completeness We found that your in-app purchase products exhibited one or more bugs which create a poor user experience. Specifically, the app kept loading indefinitely when we tapped on “Shop”. Please review the details and resources below and complete the next steps." It seems that the products are not loading properly in the environment used by the reviewers. What's most puzzling is that another app with the exact same store implementation has passed the review and is available in the store (https://apps.apple.com/pl/app/the-prince-frog/id6478831171?l=pl). I'm running out of ideas on what could be causing this discrepancy, especially since everything is functioning correctly in sandbox and TestFlight. Could someone please take a look at the code in Store.swift in this test project and point out what might be missing? Any help or insights would be greatly appreciated! Thanks in advance.
Posted
by Mac90.
Last updated
.
Post not yet marked as solved
1 Replies
697 Views
We have identified Subscription Groups for our use-case based on the below note from Apple, but there is no mention of any limitations in the doc. Can we create unlimited number of Subscription Groups or is there a limit? If your app needs to offer users the ability to buy multiple subscriptions — for example, to subscribe to more than one channel in a streaming app — you can add these subscriptions to different groups. Users who buy subscriptions in multiple groups will be billed separately for each subscription. Thanks in advance!
Posted Last updated
.
Post not yet marked as solved
1 Replies
70 Views
When using the new currentEntitlementTask ViewModifier to check for the status of a non-consumable IAP when should you call transaction.finish()? Also, since currentEntitlementTask will trigger whenever the app/view is run it will call transaction.finish every time. Is it bad to repeatedly call .finish on a already finished transaction? Currently my app works fine when making purchases and using currentEntitlementTask and @Environment to grant access to the purchased content but I know that all the transactions are unfinished and the docs say you should call transaction.finish() to tell StoreKit that you have given the user access to the content. Thanks for any help/advice here.
Posted Last updated
.
Post not yet marked as solved
1 Replies
86 Views
I have already created consumable in-app purchases in App Store Connect which are available in my app. Then I created a "Discount Code" UIButton which presented custom UI for the user to input a code for another in-app -purchase at a lower price but that build was rejected because you cannot have custom code for this sort of thing. Ref: Apple Documentation: presentCodeRedemptionSheet() Finally I got it through review when I changed the UI but then I realized that I can't offer a free consumable in-app purchase. The minimum price is US$0.29. I would prefer a free consumable in-app purchase to give to freelancers I am owkrin with for them to test the app with. I know that there are ways to do it when using subscriptions but my app only using consumable in-app purchases which align better with my business model and the value offering of my app. There must be some way of creating a single-use free consumable discount code which will also get through App Store Review. Anyone managed something like this? Thanks.
Posted
by djryanash.
Last updated
.
Post not yet marked as solved
1 Replies
57 Views
Hello Apple Developer Community, I am currently working on an xCode project that uses Objective-C and I am trying to integrate Apple's external purchase link APIs available in iOS 15.4. To use these APIs, I need to utilize async and completion handlers which are available from iOS 13 onwards. The issue I'm facing is that the current minimum deployment version for my project is iOS 12. I would like to ensure my code compiles properly for the correct iOS versions and I am also using #if available; to ensure this. However, I am unsure of how to guarantee my code builds effectively with the deployment version being set to either iOS 12 or 13. I am currently facing the following linker errors: ld: warning: Could not find or use auto-linked library 'swiftCompatibility56': library 'swiftCompatibility56' not found ld: warning: Could not find or use auto-linked library 'swiftCompatibilityConcurrency': library 'swiftCompatibilityConcurrency' not found ld: warning: Could not find or use auto-linked library 'swiftCompatibilityPacks': library 'swiftCompatibilityPacks' not found ld: Undefined symbols: __swift_FORCE_LOAD_$_swiftCompatibility51, referenced from: __swift_FORCE_LOAD_$_swiftCompatibility51_$_ProjectXYZ in ProjectXYZ.a[20](ExternalPurchaseLinkWrapper.o) __swift_FORCE_LOAD_$_swiftCompatibility56, referenced from: __swift_FORCE_LOAD_$_swiftCompatibility56_$_ProjectXYZ in ProjectXYZ.a[20](ExternalPurchaseLinkWrapper.o) __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency, referenced from: __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_ProjectXYZ in ProjectXYZ.a[20](ExternalPurchaseLinkWrapper.o) clang: error: linker command failed with exit code 1 (use -v to see invocation) I would appreciate any guidance or advice on this matter. How do I ensure my code compiles and works only for the correct versions and how do I resolve the linker errors? Thank you in advance for your assistance. Best, Sumanth
Posted Last updated
.
Post not yet marked as solved
0 Replies
63 Views
If an in-app purchase is made when my app is not running, the next time the app launches Transaction.updates will emits a transaction for the purchase. That's great. But if an in-app purchase is refunded when my app is not running, the next time the app launches Transaction.updates will NOT emits a transaction for the refund. Is that the expected behaviour? If yes, in order to check for refunds at app launch, are we supposed to cycle trough Transaction.all and search for them? Thank you
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
0 Replies
90 Views
Below, I have a button designed to facilitate the purchase of a subscription, which depends on the availability of the subscription in App Store Connect. This button is visible when testing locally using a StoreKit Configuration File synced from App Store Connect, and I have linked my subscription to my app in the information section. Currently, my app is in a "waiting for review" status, and the subscription is marked as "developer action needed - rejected." However, this issue of the button not appearing persisted even when the subscription was previously in the "waiting for review" status, indicating that the problem may not be related to the subscription status. I'm encountering an issue where the 'request products' function returns no results in the TestFlight environment, even when using a sandbox Apple ID. This problem has led to repeated rejections of my app, as testers are unable to verify its functionality. What could be causing these issues? VStack { if storeVM.subscriptions.isEmpty { if storeVM.isLoading { ProgressView("Loading subscriptions...") .progressViewStyle(.circular) .scaleEffect(2.0) .padding() } else if let errorMessage = storeVM.errorMessage { Text("Error: \(errorMessage)") .foregroundColor(.red) .padding() } else { Text("No subscriptions available") .padding() } } else { ForEach(storeVM.subscriptions, id: \.id) { product in Button(action: { Task { await buy(product: product) } }) { HStack { Spacer() Text("Unlock 3-day free trial. \nThen $23.99 per year. Cancel anytime.") .font(.custom("Lora-VariableFont_wght", size: 20)) .foregroundColor(.white) .lineSpacing(5) Spacer() } } .padding() .background(Color.black.opacity(0.6)) .cornerRadius(10) .padding(.horizontal, 10) } } .onAppear { Task { await storeVM.requestProducts() } } func requestProducts() async { isLoading = true errorMessage = nil do { subscriptions = try await Product.products(for: productIds) isLoading = false } catch { print("Failed product request from App Store server: \(error)") isLoading = false errorMessage = "Failed to load products" } }
Posted Last updated
.
Post not yet marked as solved
5 Replies
1.8k Views
I would like to programmatically keep track of offer codes that have been used. I just configured a Test Offer Code (Reference name), which contains 500 codes (Offer Codes) to buy a 1-month subscription for 0,49€. I was able to redeem the code and everything works, but I was expecting to receive the used code. Instead I received the Reference name in the payload from the App Store Server Notification in the field offer_code_ref_name="Test Offer Code". (expected was sth like offer_code_ref_name="JFFDS61SBJDBJ5BXJS4BX") I would be able to identify the Reference name by the code, if it was provided, because I have the following table in my app's backend: reference_name | code | url | expires_at | used | reserved Test Offer Code | xadz | zzz | 31-07-2022 | t | f Test Offer Code | asdf | *** | 31-07-2022 | f | f The used code doesn't seem to be included in the latest receipt. How can I obtain it? Can I somehow call App Store Connect API? Thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
75 Views
I am not sure if this is just Xcode and Storekit2 behaving weird. I am getting all products every time during my testing, even though I have pricing enabled for US and non-US in the same subscription group. How do I handle this scenario? Isn't SubscriptionStoreView supposed to handle this by itself depending on media and purchases country? Thanks in advance for your response!
Posted Last updated
.
Post not yet marked as solved
1 Replies
145 Views
I need user installed app information like first install time (purchase to install) last time use "Bundle.main.appStoreReceiptURL" to request Receipt was successful but when i Reinstall the app by Xcode has ERROR:"Error reading receipt data: Error Domain=NSCocoaErrorDomain Code=260" what wrong with ERROR?
Posted Last updated
.
Post not yet marked as solved
0 Replies
160 Views
Im building a small iphone app with StoreKit and currently testing it in testflight right on my mac, not on iphone. StoreKit part almost exactly copied from SKDemo from one of the Apple's WWDC. For some users and for myself Transaction.currentEntitlements always returns .unverified results. I double-checked Apple Connect settings, i checked my internet connection and everything is fine. Is there some pitfalls for testflight on mac? How can I find out what is causing this problem?
Posted
by kbkmn.
Last updated
.
Post not yet marked as solved
7 Replies
265 Views
As an indy developer, it's prohibitive to start developing backend receipt validation services. Is there anything else in Apple's technologies that we can use to verify whether the person who is using my app, has paid for it? The first thing I thought of when Apple rolled out Sign in with Apple ID, was hopefully, it would include some API that would allow me to ask a simply question: did this Apple ID pay for my app? As an indy developer, this is the one feature that would keep my paid app on the Mac App Store. Anyone have any good suggestions for solving this as an indy developer?
Posted Last updated
.
Post not yet marked as solved
2 Replies
454 Views
I Implement a 'SubscriptionStoreView' using 'groupID' into a project (iOS is targeting 17.2 and macOS is targeting 14.1).Build/run the application locally (both production and development environments will work fine), however once the application is live on the AppStore in AppStoreConnect, SubscriptionStoreView no longer shows products and only shows 'Subscription Unavailable' and 'The subscription is unavailable in the current storefront.' - this message is shown live in production for both iOS and macOS targets. There is no log messages shown in the Console that indicate anything going wrong with StoreKit 2, but I haven't made any changes to my code and noticed this first start appearing about 5 days ago. I expect the subscription store to be visible to all users and for my products to display. My application is live on both the iOS and macOS AppStores, it passed App Review and I have users who have previously been able to subscribe and use my application, I have not pushed any new changes, so something has changed in StoreKit2 which is causing unexpected behaviour and for this error message to display. As 'SubscriptionStoreView' is a view provided by Apple, I'm really not sure on the pathway forward other than going back to StoreKit1 which I really don't want to do. Is there any further error information that can be provided on what might be causing this and how I can fix it? (I have created a feedback ticket FB13658521)
Posted
by Lukesrad.
Last updated
.
Post not yet marked as solved
1 Replies
296 Views
Apple automatically refunds the prorated amount on the original subscription after it is upgraded. Since upgrades happen immediately and start a new billing cycle beginning from the day of upgrade, the previous original subscription is refunded for the prorated amount. Is there any way to retrieve the amount that was refunded by Apple? The transaction that was upgraded is marked with isUpgraded flag to true but the price field on it still shows the full amount and there is no App Store Server Notification that tells us how much was the refund. How do I get the refunded amount?
Posted
by kalehv.
Last updated
.
Post not yet marked as solved
0 Replies
152 Views
In StoreKit 1 and Objective-C, how do I obtain currently active subscriptions? I'm trying to obtain this information: The currently active (i.e. valid and not refunded) subscription in a subscription group A "pending" subscription, if any (when changing subscription types mid-period), and its starting date Sadly, all StoreKit 1 documents are buried deep under StoreKit 2 docs. Using StoreKit 2 is not an option.
Posted
by LIJI32.
Last updated
.
Post not yet marked as solved
2 Replies
193 Views
Hi, I am processing both REFUNDED and REVOKED transactions on the client-side and on the server using Apple's App Store Server Notifications (V2). For transactions with an inAppOwnershipType of FAMILY_SHARED, I receive REVOKE notifications that (sometimes) do not include a revocationDate. What does this imply, and what actions should I take? Additionally, when I query their transaction IDs using the App Store API, they also lack a revocationDate and do not appear in the results when I filter for revoked transactions. Is it appropriate to block these users? Why are server-to-server REVOKE notifications sent in the first place if the transaction does not appear as revoked in the API? Thanks
Posted
by nktbcc.
Last updated
.