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

Restrict In-app purchase offering based on location
I'm developing an application where user can access contents based on In-app purchase subscription.As per the app requirement I want to restrict user from accessing the content when they try to access from a different country. Example: Being a user I brought subscription while I was in India by paying lets say 10$ instead of actual 20$ (50% discount for India users). Lets say I am travelling to other country and in order to use the content user now has to pay the remaining 10$. As per apple's policy is this allowed? , if yes, then how to achieve this.
2
0
70
20h
In-App Purchase option missing in App Store version only
I just released an app to the App Store, and one of the in-app purchase options is missing. If I reinstall the TestFlight version, the option is available. If I then reinstall the App Store version, it's missing. All the other options are available and working just fine. This is how I surface them, and I've checked that all the product ids match (if they didn't they wouldn't show up in the TestFlight build). StoreView(ids: myProductIds) .productViewStyle(.compact) .storeButton(.visible, for: .restorePurchases) Any idea why one of the options wouldn't show up?
1
1
66
1d
In-App Purchase Product ID Not Retrieved by Apple Review Team
Hi everyone, I’m encountering an issue with the in-app purchase functionality in my app during the Apple app review process, and I could use some assistance. Problem Description: I’ve implemented an in-app purchase feature for the first time in my app, offering lifetime access for 300 euros. The product is created as a non-consumable type in the Apple App Store. The purchase flow works perfectly in various environments: simulator, real device, TestFlight, and sandbox accounts. However, when the Apple app review team tests the app, they encounter an error retrieving the product ID for the in-app purchase. This issue specifically occurred on an iPhone 13 Mini running iOS 17.5. Steps to Reproduce: Implemented the in-app purchase feature. Created a non-consumable product in App Store Connect. Tested the purchase flow on: Simulator Real device TestFlight Sandbox accounts Submitted the app for review. Environment: Xcode version: 14.0 iOS version: 17.5 macOS version: Ventura 13.3 Device: iPhone 13 Mini (used by review team) What I've Tried: Verified product ID and its status in App Store Connect. I'd like to assure you that the in-app purchase feature is correctly configured in the app and App Store Connect. Tested on different devices and environments: Sandbox account TestFlight account Real devices Checked all provisioning profiles and certificates. Additional Information: Despite successfully testing in all other environments, the issue persists during the Apple app review. I've submitted the binary 3 to 4 times, but the problem remains unresolved. Apple’s provided steps for configuring in-app purchases have been followed meticulously. Has anyone else faced a similar issue, or does anyone have insights on what might be causing this discrepancy during the review process? Any suggestions or advice would be greatly appreciated! Thank you in advance for your help!
0
0
48
1d
App Store Server Notifications V2 always retries five times
Hi, Our app that implemented in-app payment has been reviewed and passed and is currently in operation. However, there is a problem with the App Store server notification V2. According to the url https://developer.apple.com/documentation/appstoreservernotifications/responding_to_app_store_server_notifications, it is written as follows. "When you set up the endpoints on your server to receive notifications, configure your server to send a response. Use HTTP status codes to indicate whether the App Store server notification post succeeded: Send HTTP 200, or any HTTP code between 200 and 206, if the post was successful. Send HTTP 50x or 40x to have the App Store retry the notification, if the post didn't succeed. The system considers all other HTTP codes an unsuccessful post. Your server isn’t required to return a data value. If the App Store server doesn’t receive a success response from your server after the initial notification attempt, it retries as follows: For version 2 notifications, it retries five times, at 1, 12, 24, 48, and 72 hours after the previous attempt." We are sending an HTTP status code to the Apple server by 200 or 40x or 50x when we receive an Apple notification from the server as per the document. Nevertheless, Apple Server continues to send us 5 times App Store server notifications for each transaction. I would appreciate it if you could share how we can do it. Also, we can provide the implementation code of our server through code-level support. Thank you for your support.
3
0
126
2d
Apply increased price to existing subscribers
Hi, We previously scheduled a price change (which did NOT affect existing subscribers) however months later, we have now made a decision to apply the increase to all subscribers. As the price has not increased, I only see the option to preserve and isn't obvious if this has any effect on those grandfathered in the lower price. Can anyone confirm or must I increase the price again?
1
0
62
2d
Using in-app purchase in App Clips
Is it possible to initiate an iap flow from App Clips? There's not a clear answer to this in the docs. StoreKit is NOT listed as an unapproved framework for App Clips, but in-app purchases ARE listed as "not recommended" for App Clip functionality. I tried setting up a test with a StoreKit config file on the App Clip in XCode and the products weren't returned but... storekit testing... it would be great to get confirmation on this functionality after the iOS 17 updates.
1
0
138
1w
message extension(sticker pack), in-app purches (IAP), Review problem
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 demo project and point out what might be missing? Any help or insights would be greatly appreciated! Thanks in advance. @MainActor func requestProducts() async { do { //Request products from the App Store using the identifiers that the Products.plist file defines. let storeProducts = try await Product.products(for: productIdToEmoji.keys) for product in productIdToEmoji.keys { toDebug = toDebug + ", " + product } var newCars: [Product] = [] var newSubscriptions: [Product] = [] var newNonRenewables: [Product] = [] var newFuel: [Product] = [] //Filter the products into categories based on their type. for product in storeProducts { switch product.type { case .consumable: newCars.append(product) case .nonConsumable: newCars.append(product) case .autoRenewable: newSubscriptions.append(product) case .nonRenewable: newNonRenewables.append(product) default: //Ignore this product. print("Unknown product") } } //Sort each product category by price, lowest to highest, to update the store. cars = sortByPrice(newCars) subscriptions = sortByPrice(newSubscriptions) nonRenewables = sortByPrice(newNonRenewables) fuel = sortByPrice(newFuel) } catch { print("Failed product request from the App Store server: \(error)") errorMessage = error.localizedDescription } }
1
0
228
1w
Store kit screen automatically dismissed when using UPI payment method
I implemented a store kit in my application, which was working fine until the last three months. Recently, we have encountered an issue where the store kit screen automatically dismisses when attempting to purchase an in-app product using the UPI payment method. This issue specifically occurs with consumable products. Our non-renewable products are working fine with the same code base.
3
0
189
1w
Backyard-Birds Sample Code issue
In Apple official example code "Backyard Birds", is this code wrong? For I've tested this code many times but this part has never been executed! .onInAppPurchaseCompletion { _, purchaseResult in guard case .success(let verificationResult) = purchaseResult, case .success(_) = verificationResult else { return } showingSubscriptionStore = false } This modifier decorate code as below .sheet(isPresented: $showingSubscriptionStore) { SubscriptionStoreView(groupID: groupID) } Is it because the modifier onInAppPurchaseCompletion only works with ProductView ?
1
0
131
1w
Is there a limit to how many Subscription Groups we can create in total?
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!
1
1
808
3w
When to call transaction.finish() when using currentEntitlementTask
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.
1
0
187
3w
How do I create a free Consumable In-App Purchase?
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.
1
0
191
3w
Need Assistance with xCode Project - Linker Errors and Version Compatibility with Apple External Purchase Link
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
1
0
182
3w
StoreKit 2: Transaction.updates don't emits refunds at app launch
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
0
0
163
3w
Troubleshooting Subscription Button Visibility and Functionality Issues in TestFlight and App Store Connect
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" } }
3
0
192
3w
Where can I get used Offer Codes from?
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
5
0
1.9k
Apr ’24
SubscriptionStoreView groupID when handling country specific products with storekit2
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!
0
0
153
Apr ’24