StoreKit

RSS for tag

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

StoreKit Documentation

Posts under StoreKit tag

341 Posts
Sort by:
Post not yet marked as solved
2 Replies
498 Views
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!
Posted
by FreeRider.
Last updated
.
Post not yet marked as solved
0 Replies
347 Views
Hi, We have Apple Search Ads for promoting our app. We are able fetch attribution records of those ads using AAAttribution inside app and send to our server and it is working fine. Now, we would like to receive Install-validation postbacks by setting NSAdvertisingAttributionReportEndpoint into our domain name and configured the server to receive HTTPS POST messages as per the instruction provided in the below link. Steps done Set NSAdvertisingAttributionReportEndpoint into our domain name Our server configured the server to receive HTTPS POST messages Made sure that updatePostbackConversionValue is called while app is launched. https://developer.apple.com/documentation/bundleresources/information_property_list/nsadvertisingattributionreportendpoint In our live app, we are keep getting attribution records using AAAttribution inside our app and sending them to our server. It is working fine now. But we did not receive any Install-validation postback yet into the URL provided in NSAdvertisingAttributionReportEndpoint. To troubleshoot this, i clicked Apple Search Ad of our app in App Store, i installed our app and opened it and in the console i can see the below error message. Error updating install attribution pingback for app: <OUR_APP_ID>, error: Error Domain=ASDErrorDomain Code=1208 "SKAdNetwork: No pingbacks found while attempting to register/ update." UserInfo={NSLocalizedDescription=SKAdNetwork: No pingbacks found while attempting to register/update.}, result: 0 I have attached console log for your reference. Is there any step i am missing to receive Install-validation postback in our server? Is there any way to validate domain name provided in nsadvertisingattributionreportendpoint so that we can check if any server configuration issue? Please advise on getting Install-validation postback in our server, Thank you.
Posted Last updated
.
Post not yet marked as solved
0 Replies
241 Views
Good day! I have a problem with the presentCodeRedemptionSheet method. The problem is that when the sheet for entering the promotional code appears, I fill in the field with the promotional code and when I click the Redeem Code button, nothing happens, the button becomes inactive for some time, but nothing else happens, the promotional code is not applied. However, this behavior occurs every now and then, that is, to put it simply, this flow works only 1 time out of 5 times, and then not always. Please tell me, has anyone encountered this problem before?
Posted Last updated
.
Post marked as solved
4 Replies
693 Views
We use store kit original API for in-app purchase,I set a UUID to the SKMutablePayment object applicationUsername property, when finish the payment, In the App Store Server API, the JWSTransactionDecodedPayload object returns no appAccountToken field.This probability is extremely small, about 17 in 100,000.Does anyone have the same situation?
Posted
by YaTian.
Last updated
.
Post not yet marked as solved
0 Replies
248 Views
The StoreKit offerCodeRedemption(isPresented:) view modifier is working fine for redeeming consumable offers from App Store Connect, but it fails to redeem subscription offers: When this same offer code is used in the App Store redemption flow, everything works as expected. So there's nothing wrong with the offer codes. Is there a trick to using offerCodeRedemption(isPresented:) when working with subscriptions rather than consumables? Any help is appreciated!
Posted
by Ken_D.
Last updated
.
Post not yet marked as solved
0 Replies
275 Views
Testing in-app purchase with the App Store Connect / Xcode configuration file allows testing of approximately 43 non-consumable product errors. Testing my non-consumable in-app purchase with the new ProductView on my app for these various faults doses’t appear to be very promising. Loading errors: all result in a blank screen and spinning wheel without producing an alert. Purchase errors: Some of these work producing readable comments. Purchase (not entitled) and Purchase (system error) just produce alert boxes with an OK button. Purchase (network) produces the alert “The operation could not be completed. (NSURLErrorDomain error - 1009.)” Verification errors, App Store Sync, and App Transaction errors: These purchases are successful and produce no alerts. Am I missing a method that handles these errors? With ProductView do I need to use a do / catch block in my viewModel? Can I release this app for review working like this? struct StoreView: View { @StateObject private var store = StoreModel() var body: some View { GeometryReader { g in VStack { Spacer() Text("\(mainTitle)") .font(.title) .padding(.bottom, 25) ProductView(id: "xxxx") { _ in Image(systemName: "xxxx") .resizable() .scaledToFit() } placeholderIcon: { ProgressView() } .productViewStyle(.large) .overlay( RoundedRectangle(cornerRadius: 20) .stroke(Color( "darkGreen"), lineWidth: 5) .frame(width: g.size.width * 0.90, height: g.size.height * 0.35 ) ) .frame(maxWidth: .infinity, alignment: .center) Spacer() } } } } @MainActor final class StoreModel: ObservableObject { @Published private(set) var products: [Product] = [] @Published private(set) var activeTransactions: Set<StoreKit.Transaction> = [] @Published var gotRefund = false // use to reset purchase private var updates: Task<Void, Never>? private var productIDs = ["xxxxx"] // app wide purchase status @AppStorage(StorageKeys.purStatus.rawValue) var storeStatus: Bool = false init() { updates = Task { for await update in StoreKit.Transaction.updates { if let transaction = try? update.payloadValue { await fetchActiveTransactions() // check transaction.revocationDate for refund if transaction.revocationDate != nil { self.storeStatus = false // requesting refund self.gotRefund = true } else { self.storeStatus = true // making purchase } await transaction.finish() } } } } // end init deinit { updates?.cancel() } // update the current entitlements func fetchActiveTransactions() async { var activeTransactions: Set<StoreKit.Transaction> = [] for await entitlement in StoreKit.Transaction.currentEntitlements { if let transaction = try? entitlement.payloadValue { activeTransactions.insert(transaction) } } self.activeTransactions = activeTransactions } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
313 Views
I had everything working with Revenue Cat. Then my app got rejected for not loading subscriptions, which was odd because a previous built was rejected for wording on that same paywall. I checked, and realised I suddenly can't fetch products in testFlight either. I can only see products in Xcode using the store kit configuration file. I've found many issues like this online and everybody point to the same solutions (that seem to work for most), but here's what I tried so far: Checked that all my agreements in App Store Connect are active Checked that ids match between Xcode / revenue cat / App Store connect Store kit config file is syncing with App Store Connect correctly I removed revenue cat and used the store kit api directly to fetch products. The array of products is empty in all environments that don't have access to store kit config file. Checked status of all subscriptions (all waiting for review -- as they were when the paywall worked) Nothing seems to work... Any suggestions? Many thanks
Posted
by guyguy.
Last updated
.
Post not yet marked as solved
1 Replies
281 Views
I followed the official Apple documentation to integrate external puchase, but after adding the com.apple.developer.storekit.external-purchase key to the entitlements plist file, I got the following error: "Provisioning profile "{company name}" doesn't include the com.apple.developer.storekit.external-purchase entitlement." error and fails to build. https://developer.apple.com/support/storekit-external-entitlement-kr/
Posted
by gpwl.
Last updated
.
Post not yet marked as solved
2 Replies
314 Views
Our app was just rejected by Apple because they say the subscription management sheet never loads. It just spins indefinitely. We're using StoreKit's manageSubscriptionsSheet view modifier to present the sheet, and it's always worked for us when testing in SandBox. Has anyone else had this problem? Given that it's Apple's own code that got us rejected, what's our path forward?
Posted
by Ken_D.
Last updated
.
Post not yet marked as solved
0 Replies
258 Views
In our app we fetch the storefront country code: SKPaymentQueue.default().storefront?.countryCode We were not sure if all users will have this property available and we track to Bugsnag when this is nil. It turned out that over 6k users don't have this property available (shortly after the release) the number is larger than we expected. Looks like it affects all iOS versions (87 iOS versions from iOS 13.x to iOS 17.x) and models (95 in our case). It is not clear when and why this would be nil. It is not related to internet availability or to the timing of calls (e.g. it happens shortly after the app starts or hours after the app was started). So, when and why would the SKPaymentQueue.default().storefront be nil`? Thanks!
Posted
by bastawa.
Last updated
.
Post not yet marked as solved
1 Replies
359 Views
All of a sudden, I am no longer able to test in app purchases on testflight builds. try await Product.products(for: [productID]) returns an empty array. Production (app in app store) functions just fine. But when I test the release build of the production version or any other versions, the fetch returns an empty array. This seems to be a sandbox issue. The ID is correct, Tax and banking forms are valid... This isnt the first release with in-app purchase or subscriptions so I am not sure why I am having this sandbox issue.
Posted
by Roselinn.
Last updated
.
Post not yet marked as solved
0 Replies
167 Views
We have 5 subcourses like below subcourse1 - 10RS subcourse2 - 20RS Sucourse3- 5RS subcourse4- 11 RS supcouse5 - 12RS If the user selected sourcouse1 and subcourse3 and chose external gateway then we can easily take 15rs payment from external gateway (for any combination of selection of subcourses). Now if user selected subcourse1 , subcourse2, subocourse4 and chosen in app purchase option now we have to take payment of 41rs together. this is not possible unless we create any sku of combination of subcourse1 , subcourse2 and subcourse4. (practically we can create all sku combination for 5 sub courses) for subcourse1, subcourse2 and subcourse3 there are possible combination are subcourse1 subcourse2 3.subcourse3 4. subcourse1 and subcurse2 5. subcourse1 and subcourse3 6. subcourse2 and subcourse3 So we need to create 5 sku in app purchase for taking payment for all user selection combination Now if we have a total of 10 subcourses then there will be multiple combinations (total 3,628,800) . it is not practical to create sku for all 3,628,800 combination please suggest any way to handle my use case or should We prefer external gateway?
Posted Last updated
.
Post not yet marked as solved
1 Replies
391 Views
I have uploaded one of my app to give some paid service. But when the user tries to make an in-app purchase, it opens one screen like the title is "Apple ID, Almost there Payment request will be created for xyzdemo@ybl" After I press the continue button this window(Screen) closes automatically. But UPI requests are sent on the particular app. So why is this happening on my app? Why does this window (Screen) dismiss automatically? I have also attached the screen. This screen automatically dismissed.
Posted
by Vipul0074.
Last updated
.
Post not yet marked as solved
0 Replies
183 Views
The in-app payment window is not displayed on the commercial apps deployed in the App Store. (IAP is subscription type) It is a WKWebView app, and in the development environment (build, testflight), the in-app payment window is displayed when the product button is pressed (sand box environment) This app has been commercially distributed. And when you press the product button in actual commercial, the in-app payment window is not displayed. Before payment, access the apple receipt server corresponding to the commercial server, determine whether it is [already subscribed] and display the payment window. [Example] https://buy.itunes.apple.com/verifyReceipt I got you to call. The source code related to No. 3 above is complicated, but there are many do-catch and if-else, and if it does not work normally, the source code is written to display an error message using an alert, but the alert is not displayed in actual commercial use.
Posted
by SewonKim.
Last updated
.
Post not yet marked as solved
0 Replies
375 Views
I am going to offer a Bundle of ten(10) apps having auto-renewing subscriptions. My question is when user will purchase a subscription in ONE app. Will all other apps(non-purchased) also have RECEIPT available of the one purchased app's receipt? So,i can validate user have purchased one of apps from Bundle.
Posted
by israr786.
Last updated
.
Post not yet marked as solved
1 Replies
305 Views
My app is a login item that gets registered as a background agent using SMAppService. On launch it checks to see that the user has an active subscription, and when I run it from Xcode, this works fine. But it seems that if I restart my machine and it is run from launchd right at login, StoreKit doesn't return any purchases. This results in my app throwing up a window to tell the user to subscribe. It’s hard to be sure this is the behavior, because I can't really use a debugger, and for whatever reason, OSLog is not persisting messages (despite being configured to do so). Does anyone know if it takes a while after restart or login for Store Kit to reliably return purchases?
Posted
by JetForMe.
Last updated
.
Post not yet marked as solved
0 Replies
302 Views
The docs for Transaction.updates say: Use updates to receive new transactions while the app is running. This sequence receives transactions that occur outside of the app, such as Ask to Buy transactions, subscription offer code redemptions, and purchases that customers make in the App Store. It also emits transactions that customers complete in your app on another device. Note that after a successful in-app purchase on the same device, StoreKit returns the transaction through Product.PurchaseResult.success(_:). So Transaction.updates isn't supposed to include transactions for purchases that are made in this instance of the app, right? I have this code to get those transactions: SubscriptionStoreView(groupID: group_id) { } .onInAppPurchaseCompletion() { product, result in ..... } But when I make a purchase using this SubscriptionStoreView, I see that both this .onInAppPurchaseCompletion code and my code observing Transaction.updates is called. Is this expected? Will it work reliably without the .onInAppPurchaseCompletion ? Thanks.
Posted
by endecotp.
Last updated
.
Post not yet marked as solved
1 Replies
301 Views
StoreKit.Transaction has an expirationDate property, but not a gracePeriodExpirationDate property. Product.SubscriptionInfo.RenewallInfo has a gracePeriodExpirationDate but no expirationDate. If I have enabled a grace period I think I need to check both. That seems more complicated than it should be. Am I missing something?
Posted
by endecotp.
Last updated
.
Post not yet marked as solved
0 Replies
264 Views
If I use SubscriptionStoreView.init(groupID), it seems to be able to look up all the Products that have that subscription group ID. But I don't see any public method for doing that myself. Am I missing something, or is SubscriptionStoreView using a private method to do this lookup? I know that historically it has always been necessary to know the product IDs of all the products you want to sell; you have never been able to ask Store Kit to give you a list. SubscriptionStoreView doesn't seem to have this limitation, which is a bit surprising.
Posted
by endecotp.
Last updated
.
Post not yet marked as solved
0 Replies
197 Views
The store review alert is shown hidden behind UI, I'm 100% sure it shows up, and I can see it when the current view is empty/transparent. I tried using various ways to find the current window, launching on different threads but nothing works. I have no idea what else to try the library doesn't really provide any documentation or anything. If it matters we are using the unity framework in the app, and it is a multi-window app. if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene { serviceProvider.reviewService.requestReview(in: scene) } this is the invocation, the service then calls func requestReview(in scene: UIWindowScene) { SKStoreReviewController.requestReview(in: scene) } the result is that the prompt is shown, but it is hidden behind ui elements, if the view is empty, the prompt is visible and interactable.
Posted
by Mikok.
Last updated
.