I'm developing an iOS app that supports in-app purchases and I'm using StoreKit2 for handling transactions. While purchase, promotion, and restore purchase functionalities are working fine, I'm facing an issue with offer code redemption.
When I present the offer code redemption sheet using:
``SKPaymentQueue.default().presentCodeRedemptionSheet()``
I am able to redeem the offer code in App Store sheet. It's showing success. But after offer code redeem SKPaymentTransactionObserver does not seem to receive any updates or notifications. Specifically, the paymentQueue(_:updatedTransactions:) method is not being called.
public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])
import StoreKit
`class YourClass: NSObject, SKPaymentTransactionObserver {
override init() {
super.init()
SKPaymentQueue.default().add(self)
}
deinit {
SKPaymentQueue.default().remove(self)
}
public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction in transactions {
switch transaction.transactionState {
case .purchased:
print("Transaction Purchased")
SKPaymentQueue.default().finishTransaction(transaction)
case .failed:
print("Transaction Failed")
SKPaymentQueue.default().finishTransaction(transaction)
case .restored:
print("Transaction Restored")
SKPaymentQueue.default().finishTransaction(transaction)
case .deferred:
print("Transaction Deferred")
case .purchasing:
print("Transaction Purchasing")
@unknown default:
print("Unknown Transaction State")
}
}
}
}
`
So I am not able to update the UI and also not able to send the details to server.
Steps I’ve Taken:
Verified that the observer is added to the SKPaymentQueue in the initializer and removed in deinit.
Tested on a real device, not just the simulator.
Checked that the offer code is valid and properly set up in App Store Connect.
Verified that the latest version of Xcode is being used.
Questions:
Is there a known issue with offer code redemption in StoreKit2 that might cause the observer not to receive notifications?
Are there additional steps or configurations required to ensure that the transaction observer is notified about offer code redemptions?
Are there any common pitfalls or troubleshooting tips for dealing with this issue?
Any assistance or insights would be greatly appreciated!
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
I have accessed the third-party payment Qonversion, which has been uploaded to testflight, and some phenomena such as purchase failure or purchase waiting time out occurred when the customer used it
The Qonversion developer replied that there were too many requests for this account and needed to change the account, is that right
Do you need to change your account? How do you return the account? I want to know how testflight can correct the sandbox account instead of its own account
I have accessed the third-party payment Qonversion, which has been uploaded to testflight, and some phenomena such as purchase failure or purchase waiting time out occurred when the customer used it
The Qonversion developer replied that there were too many requests for this account and needed to change the account, is that right
Do you need to change your account? How do you return the account? I want to know how testflight can correct the sandbox account instead of its own account
Hi,
I am not able to make any purchases in the sandbox environment and am getting the following error. Can someone please help me understand where the issue is?
<SKPaymentQueue: 0x300d31ca0>: Payment completed with error: Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={client-environment-type=Sandbox, storefront-country-code=IND, NSUnderlyingError=0x300396ee0 {Error Domain=AMSErrorDomain Code=305 "Purchase Failed" UserInfo={NSLocalizedDescription=Purchase Failed, AMSURL=https://sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy?guid=00008030-001D282A2E42402E, AMSStatusCode=200, AMSServerPayload={
"cancel-purchase-batch" = 1;
customerMessage = "Unable to process your request.";
dialog = {
defaultButton = ok;
explanation = "Please try again later.\n\n[Environment: Sandbox]";
initialCheckboxValue = 1;
isFree = 1;
"m-allowed" = 0;
message = "Unable to process your request.";
okButtonString = OK;
};
failureType = "";
"m-allowed" = 0;
metrics = {
actionUrl = "sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy";
asnState = 0;
dialogId = "MZCommerce.SystemError";
eventType = dialog;
message = "Unable to process your re";
mtEventTime = "2024-08-06 04:47:27 Etc/GMT";
mtTopic = "xp_its_main";
options = (
OK
);
};
pings = (
"https://xp.apple.com/report/2/xp_its_main?code=MZCommerce.SystemError&buttons=OK&baseVersion=1&dsId=21818342290&eventVersion=1&storeFrontHeader=143467-2%2C29&eventTime=1722919664789&eventType=dialog&message=Unable%20to%20process%20your%20re"
);
},
Topic:
App & System Services
SubTopic:
StoreKit
I need some clarification from a functionality perspective. For example, in the application, a user can add a post and make it private. If anyone wants to view that post, they must pay an amount specified by the user when adding the post. This is the basic scenario. The main point of concern is price distribution.
If the price of the post is $3.99, 10% of this amount goes to the app admin, and the remaining 90% goes to the user who posted the content, after accounting for Stripe's fees.
My question is: We believe this functionality cannot be achieved using 'in-app purchases.' Need Assistance on this; whether scenario is achievable with 'in-app purchases'? If so, how can it be implemented?
We would like to provide auto-renew subscription in our app and we have these questions:
when provide offer codes for auto-renewable subscriptions using presentCodeRedemptionSheet() to let the user enter redeem code
is it ok we put the redeem code in clipboard so that user just need to paste to enter ?
we should present a screen that let user to choose which duration to subscribe, so that we can provide proper redeem code for user to use in system redeem sheet (call out by presentCodeRedemptionSheet()), am I right ?
if user apply the redeem code, the system redeem sheet will emit the resulting transaction as if purchase the corresponding subscription by in-app purchase, am I right ?
P.S.
As we can't test redeem an offer code for an auto-renewable subscription in sandbox, so we don't know the exact flow of it and need to ask in forum.
Topic:
App & System Services
SubTopic:
StoreKit
I'm trying to test in-app purchases in my app in the sandbox environment. I've purchased a one-time purchase in the app, but no purchases are visible under "Manage Transactions..." in Xcode. Deleting the app from the device as well as deleting the directories ~/Library/Caches/com.apple.appstoreagent and ~/Library/Caches/com.apple.storekitagent does not remove the purchase from the app. This makes it impossible to fully test purchases in the app.
what can I use direct bank transfer for buying premium account in my app?
because I found an application in the App Store that without a marker provides in-app purchases, but when the application is opened, this application offers an upgrade to a premium account to be able to access all features and the purchase process by bank transfer to the application owner's account.
so now we can use our bank account directly to process payment in app without using in app purchases system by apple, right?
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
App Store Connect
Subscriptions
In-App Purchase
StoreKit
PLEASE HELP
MY PHONE SCREEN TURN GREEN
WITHOUT ANY PHYSICAL DAMAGE
I’m developing an app similar to Patreon where creators can decide if they want to charge either $5 or $10 a month for users to be able to view their content (each creator can only have one subscription price defined)
I came across information that the only way users can subscribe to multiple subscriptions (each from a different creator) in one app, those subscriptions need to be defined in their own Subscription Group. However, it seems that Subscription Groups need to be manually, pre-defined through an online portal and go through an approval process. So the number of Subscription Groups created would have to match the number of creators.
This wouldn’t scale because I need the ability for those subscriptions to be created on the fly when new creators sign up.
Am I understanding that correctly? If so, how can I get around this?
I'm currently working on an iOS app where I want to provide users with an in-app update feature. For this, I'm considering using SKStoreProductViewController to present the App Store page of my app, allowing users to update it directly.
However, I'm concerned about whether Apple might reject my app during the review process for using this method. Is using SKStoreProductViewController for in-app updates acceptable according to Apple's guidelines, or is there a better approach to handle in-app updates?"
This is the code below
func openAppStore() {
let storeViewController = SKStoreProductViewController() storeViewController.delegate = self
let appStoreURL = URL(string: "https://apps.apple.com/app/id333903271")! let parameters = [SKStoreProductParameterITunesItemIdentifier: "333903271"] storeViewController.loadProduct(withParameters: parameters)
{ _, error in if error != nil { UIApplication.shared.open(appStoreURL) } else { self.viewController?.present(storeViewController, animated: true) } } }
<SKPaymentQueue: 0x3037e64a0>: Payment completed with error: Error Domain=ASDServerErrorDomain Code=3504 "This item cannot be found." UserInfo={storefront-country-code=USA, AMSServerErrorCode=3504, client-environment-type=Sandbox, NSLocalizedFailureReason=This item cannot be found.}
Topic:
App & System Services
SubTopic:
StoreKit
My app has its own membership system, but I’m encountering a conflict with the subscription management provided by Apple ID.
Here’s the issue: Suppose a user creates Account A and starts an auto-renewable subscription X, which is set to expire on 2024-09-15 at 12:00. This subscription can be managed within the iPhone settings. Later, the user logs out of Account A and logs into Account B, and then tries to purchase auto-renewable subscription X, the iPhone displays a popup message stating that the user is already subscribed to this item, preventing them from starting an auto-renewable subscription for Account B.
I’ve tested other apps, such as iQIYI, and noticed that they do not have this issue. How can I resolve this problem? Are there any resources or documentation that can help? I’m currently using the StoreKit2 API.
Topic:
App & System Services
SubTopic:
StoreKit
Hi All,
We are developing an educational platform similar to Udemy and are integrating in-app purchases for our mobile app to list it on the App Store. We have a few questions regarding in-app purchases:
Price Limit: We understand that there is a maximum price limit of $1000 for any single in-app purchase product on the App Store. Is there any way to obtain an exception to this limit for our use case, as our client requires it?
Multiple Products in a Single Transaction: Is it possible to purchase multiple products in a single transaction? We have a large number of products, and creating bundles in App Store Connect is not feasible for us. Are there alternative methods to achieve this?
Dynamic Discounts and Offers: Can we apply discounts and offers to our products dynamically? We need to be able to modify pricing and promotions based on various factors. What are the best practices for implementing this?
Topic:
App & System Services
SubTopic:
StoreKit
Multiple calls restorePurchase first time normal, the second is very slow, wait 2 minutes to have the order back drop back, and each time this function - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *) transactions are executed twice this is executed once - (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue really magical!
Topic:
App & System Services
SubTopic:
StoreKit
When verifying the receipt to 'https://sandbox.itunes.apple.com/verifyReceipt', the status code 21199 is always returned. Even if the verification is performed again after an interval, the status code 21199 is still returned. How can this problem be solved?
SKStoreReviewController.requestReview() is deprecated in favor of AppStore.requestReview(in:). The problem is that AppStore.requestReview(in:) requires passing in a NSViewController, and in some contexts, this is not possible. For example, a menu bar app that only has a NSMenu when you click it. It has no NSViewController that could be passed in. How are we supposed to request a review for such apps?
FB14887376
Topic:
App & System Services
SubTopic:
StoreKit
It seems that starting from around 2024-08-20T10:28:00 UTC, both the "trialPeriod" and "introOfferPeriod" fields are set to true in the receipt data of free-trial subscriptions. Before that time only trialPeriod was set to true while introOfferPeriod was false.
Just want to confirm whether this is an expected and permanent change?
Thanks.
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
In-App Purchase
App Store Receipts
Hi, I have a question regarding a set of existing in app purchases as we are planning on making a set of changes to our application.
For context we are a B2B application that sells a web based tool directly to businesses. Really due to historical reasons we made recurring subscriptions available in the iOS app store and have a number of tiers users can select.
Our service is getting a little more complicated, we offer a lot of stuff outside of the app store and looking at the rules:
3.1.3(f) Free Stand-alone Apps: Free apps acting as a stand-alone companion to a paid web based tool (e.g. VoIP, Cloud Storage, Email Services, Web Hosting) do not need to use in-app purchase, provided there is no purchasing inside the app, or calls to action for purchase outside of the app.
It would make a lot of sense for our App to become a companion to our main service. As far as I understand this means what we need to remove the App Store subscriptions, there is no call to action in app to buy outside of the app store.
However, what happens to the existing subscribers to the service? By removing the in app purchases from the app will these existing subscribers still continue to be subscribed?
We don't have that many users that buy in app but we don't want to mess up their experience. For example, we don't want these subscriptions to just cancel and their access be removed. Also is this a fair understanding of the rules as we don't want to fall foul of them.
I think this is a similar question to this thread, but obviously want to check before making this change.
Thank you!
Hello,
I am making an e-commerce app. We plan to charge user's to make a listing for 15% of the sale price capped at £35, and are trying to figure out if we need to use IAP?
From what I can find, other companies in the same area don't use them - for example Autotrader takes you off their app to there website when you try to make a listing, and you pay for the listing there.
Any advice would be greatly appreciated.