Hi,
I'm attempting to use StoreKit 2 and SwiftUI to add a tip jar to my iOS app. I've successfully added consumable IAPs for each of my tip sizes, and used ProductView to show these on my tip jar screen. However, I am at a loss on how to do the following things:
How and when do I finish the consumable IAP transaction? I see the finish() function in the documentation, but I am not sure how I can call it given that ProductView is handling the purchase for me (I have no access to a Transaction object).
How can I track the amount of consumable IAPs the user has purchased across all their devices? I want to show the user the amount of money they have tipped in total. I have added SKIncludeConsumableInAppPurchaseHistory to my Info.plist and set it to YES as suggested here: https://forums.developer.apple.com/forums/thread/687199
This is my first time using StoreKit 2 (until now, I was using StoreKit 1), so I would really appreciate any advice and guidance you can provide. Thanks!
StoreKit
RSS for tagSupport in-app purchases and interactions with the App Store using StoreKit.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
No matter what I do whether I delete the app or reset my phone it still prompts me to log in to the previous sandbox test account. I'm not even signed into that account on my phone or in the App Store.
Topic:
App & System Services
SubTopic:
StoreKit
Hi all,
I’m testing Subscription in my Flutter app on a real iOS device (iPhone 16 Pro with iOS 18) via TestFlight. I’ve set everything up as required, but I still get this error:
flutter: Found products: []
If everything works perfectly when StoreKit configuration is used in Xcode, but not via TestFlight.
All my Subscriptions are approved with the same ID.
So, we've implemented IAP with StoreKit2 e2e for both the client and backend and it's working mostly perfectly, however we have an issue which we can't seem to understand Apple's behavior.
So, imagine a purchase that occurred on the 10th of December in the sandbox environment through an install from TestFlight, and this same purchase keeps getting queued in the Transaction.unfinished list for some reason (today, the 17th of December, a whole week after the initial purchase!).
Here's the flow:
We iterate the list on app launch
Send the unfinishedTransaction's transactionId to our servers
The server says "hey, we could verify it with Apple but it's not longer active (expired). We can't really work with it so just finish it on your side and don't send it to me again"
The client finishes!! the transaction
On the very next app launch it keeps reappearing in the Transaction.unfinished queue
Are we doing something wrong, why doesn't it get cleaned? Is this an expected behavior?
Note, this is generally the server's logic for new purchases:
If we weren't able to contact Apple - we tell the client to not finish the transaction so that we'll be able to re-iterate it on the next app launch or retry
If the transaction is not expired and valid - we update our records and tell the client to finish the transaction
If we couldn't update our records - we tell the client to not finish the transaction so that we'll be able to re-iterate it on the next app launch or retry
If the transaction is not valid for some reason - we tell the user to finish the transaction
The server might see it as a valid transaction if we'll send the originalTransactionId instead of the 'transactionId(using it to callgetTransactionInfoinAppStoreServerLibrary`), but is this something we want to do?
This will obviously not fix the problem because the server tells the client to finish the transaction anyways, but it simply doesn't work.
Please, any advice or changes to make to either Client/Server would be greatly appreciated
Best Regards, Ofek
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit
App Store Connect
In-App Purchase
I work as QA and we develop mobile farm game. Inside our game we have shop where user can buy coins or special prem.coins. And interface shows price with Apple Tax. Also we have battle pass, and when user want to buy battle pass the price shows without Apple tax.
Anybody knows what is wrong?
Pass price inside game > 9.99$
Price when user want to buy it > 11.99
Topic:
App & System Services
SubTopic:
StoreKit
I get crash reports which I can't reproduce when trying to present an SKStoreProductViewController :
Fatal Exception: UIApplicationInvalidInterfaceOrientation
Supported orientations has no common orientation with the application, and [SKStoreProductViewController shouldAutorotate] is returning YES
No matter what app Deployment info orientation I try I can't get my SKStoreProductViewController shouldAutorotate property to return YES. It is always false.
Does anyone knows why or how to get an SKStoreProductViewController to return shouldAutorotate YES?
Topic:
App & System Services
SubTopic:
StoreKit
当verifyReceipt API被标记为Deprecated后,我尝试通过调用Get Transaction Info API查询订单信息,对用户的内购订单做校验,但是响应结果中没有支付状态,APP服务端如何才能确认用户是否已经成功支付?还有附带的问题是如何做参数透传(即用户支付时APP调用Apple服务端将开发者自定义的参数带过去,然后APP服务端调用Apple服务端API时拿到这个参数),类似google内购的developerPayload参数
Topic:
App & System Services
SubTopic:
StoreKit
I try to access the AppDistributor.current (using try await) and the property never seem to return nor throw.
The code I'm using looks like this:
do {
print("accessing current")
let current = try await AppDistributor.current
print("current obtained")
switch(current) {
case .appStore:
return "AppStore"
default:
return "Unknown"
}
} catch {
return "Exception: \(error)"
}
But the log only shows the accessing current and never the current obtained. Trying to step in the property starts with some assembly, but at some point, the debugger just never returned. I join a full Swift file of a sample test I'm using:
SwiftMarketplaceTests.swift
Topic:
App & System Services
SubTopic:
StoreKit
We have a user that has an active subscription according to the appstore in our product but it is registering as expired. Hitting the subscribe button in the SwiftUI SK2 dialog does nothing, meaning, nothing happens.
Any ideas?
Topic:
App & System Services
SubTopic:
StoreKit
I cannot test IAP using sandbox account that I logged on from settings, it keeps show my regular Apple ID when I try to test IAP from TestFlight
This issue frustrate me and bunch of my colleagues, we cannot manage our subscription when sandbox account is default choosing Apple ID
I've seen people complaining about this issue a lot
Any help on resolving this issue would be really appreaciated
A customer of mine signed up for a free trial. I got a apple server notification with notification type DID_RENEW. What does that mean? Does that mean that they will be charged the subscription price now?
I want to sell the same subscription in multiple apps so that if someone subscribes in one they show up as having a subscription in the other.
Apple's documentation states "To get started, use App Store Connect to create a separate and equivalent auto-renewable subscription for each app that offers the multi-app subscription so that users can subscribe from any app." (https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/subscriptions_and_offers/offering_a_subscription_across_multiple_apps)
But I'm unable to create two subscriptions with the same Product ID. I could create two subscriptions that are equivalent but with different Product IDs that are treated as the same by our server, which would accomplish the main goal, but I believe this risks someone subscribing to both subscriptions if they do so directly through the App Store, for example using a promo code link, because they're still two different subscriptions to Apple.
Thanks!
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
App Store Connect
Subscriptions
App Store Server Notifications
If you are experiencing an unexpected or inconsistent behavior when using the App Store Server Library, review the following resources to ensure that your implementation workflow didn’t cause the issue:
Simplifying your implementation by using the App Store Server Library
Explore App Store server APIs for In-App Purchase
Meet the App Store Server Library
If you are unable to resolve your issue using the above resources, file a GitHub issue. Alternatively, if you wish to provide specific requests, transactions, or other private information for review, submit a Feedback Assistant report with the following information:
The bundleId or appAppleId of your app
The date and time your issue occurred
The library language(s)
The version of the library
The environment (i.e., Production, Sandbox, or Xcode)
The GitHub issue for this report if available
The endpoint(s) reproducing your issue
The HTTP body and headers of the endpoint raw request
The HTTP body and headers of the endpoint response
To submit the report, perform these steps:
Log into Feedback Assistant.
Click on the Compose icon to create a new report.
Select the Developer Tools & Resources topic.
In the sheet that appears:
Enter a title for your report.
Select “App Store Server Library” from the “Which area are you seeing an issue with?” pop-up menu.
Select “Incorrect/Unexpected Behavior” from the “What type of feedback are you reporting?” pop-up menu.
Enter a description of your issue and how to reproduce it.
Add the information gathered above to the sheet.
Submit your report.
After filing your report, please respond in your existing Developer Forums post with the Feedback Assistant ID. Use your Feedback Assistant ID to check for updates or resolutions. For more information, see Understanding feedback status.
This documentation describes what kind of data we should be sending to Apple server, once we are receiving CONSUMPTION_REQUEST
https://developer.apple.com/documentation/appstoreserverapi/consumptionrequest
But, it doesn't describe what kind of data we are receiving, when we are receiving CONSUMPTION_REQUEST?
May I know, is such a document available?
Thank you.
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
App Store Server Notifications
App Store Server API
App Store Server Library
Hello,
I am consistently receiving the error message "In-app purchases are not allowed on this device" whenever I try to make an in-app purchase on my iOS device. Despite following all the recommended solutions I could find online, the issue remains unresolved.
Here is a list of the steps I have already taken:
Checked Screen Time Settings:
I navigated to Settings > Screen Time > Content & Privacy Restrictions > iTunes & App Store Purchases.
I have confirmed that "In-App Purchases" is set to "Allow." I have also tried toggling this setting off and on again.
Signed Out & In of Apple ID:
I signed out of my Apple ID via Settings > [Your Name] > Media & Purchases, restarted the device, and then signed back in.
Restarted the Device:
I have force-restarted my device multiple times.
Updated iOS:
I have ensured my device is running the latest version of iOS (checked via Settings > General > Software Update).
Verified Payment Method:
I have confirmed that my payment method on file is valid and up-to-date.
Created a New Sandbox Account:
I also created a new Sandbox Tester account in App Store Connect and tested with it, but the result was the same.
Device Information:
Device Model: iPhone 15, iPhone 13
iOS Version: iOS 17.5, iOS 18
Even after performing all of these steps, the problem persists. Has anyone else encountered such a stubborn issue, or does anyone have a different solution I could try?
Thank you in advance for your help.
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit Test
StoreKit
In-App Purchase
Does anyone know why I set the offer code in Apple Store Connect, but when I call SKPaymentQueue.default().presentCodeRedemptionSheet() in the app, the app icon does not appear and I cannot find the offer code?
THX
I would like to know if it is possible to use the PIX payment option, a Brazilian payment method, for in-app purchases. Additionally, I would like to know if it is already possible to integrate other payment APIs such as MercadoPago, Iugu, etc.?
Hello all,
We developed an iOS app which we started advertising now. In our iOS app we already implemented the updatePostbackConversionValue(_:completionHandler:) to send in-app events in increasing numbers (first open -> 1, lead ->2, conversion -> 3).
From our understanding this should be enough for alle ad networks (Apple Ads, Google Ads, Meta Ads, Microsoft Ads and Reddit Ads) to receive those numbers - at least they receive the app installs from the SKAN already.
Is this correct or do we miss something here in the integration? We currently really struggle to assure that everything is working and we do not see any conversions coming in - even though two weeks of advertising have passed already.
I look forward for any feedback or discussion and I am also happy to share more details if needed.
Best regards,
Manuel
Topic:
App & System Services
SubTopic:
StoreKit
I have setup offer codes and subscriptions for users to purchase, when a user signs up using an offer code outside of the app the offer code does not save into my database where the subscriptions are saved
the transaction is successful and validated by store kit but I cant see that that user used an offer code - an example
https://apps.apple.com/redeem/?ctx=offercodes&id=6744338284&code=ASKDOM
I then setup an edge function in supabase to retrieve the data that store kit sends back and im not sure where to find the offer code as it still doesnt save
is there an internal apple reference that they use as apposed to the users offer code i.e offer code askdomSA = P3050 for example
how can Identify if an offer code was used
thank you
The guidance provided only explains how to remove the entire app from review, but not how to remove a single subscription. Currently, I have one incorrect subscription that has been rejected due to localisation issues, and it is stuck in the "In Review" status. Unfortunately, I am unable to make changes to it.
The correct subscription is in the "Waiting for Review" status, and while I am able to remove it, there is no need to do so. What I would like to do is remove the previous, incorrect subscription.