StoreKit

RSS for tag

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

Posts under StoreKit tag

183 Posts

Post

Replies

Boosts

Views

Activity

StoreKit2 AppTransaction originalPurchaseVersion
I am looking to move from paid app to fremium without upsetting my existing users. I see WWDC2022 session where new fields introduced in iOS 16 are used to extract original application version user used to purchase the app. While my app supports iOS 14 and above, I am willing to sacrifice iOS 14 and go iOS 15 and above as StoreKit2 requires iOS 15 at the minimum. The code below is however only valid for iOS 16. I need to know what is the best way out for iOS 15 devices if I am using StoreKit2? If it is not possible in StoreKit2, then how much is the work involved in original StoreKit API(because in that case I can handle for iOS 14 as well)?
1
0
657
Jan ’25
Puchases / subscriptions issues
Hi, I've some issues on my application about purchases. My app is available for iOS and tvOS. Some part of my code is the same on both target (my purchase code is one of them). The issue is: Some users can't do a purchase on Apple TV (but not all and I can't reproduce) Some users purchased on a device and are not considered as pro on the other device (logged with same apple account). Again it's not all. Here is my store code
1
0
297
Jan ’25
How do win-back offers displayed for discounted subscriptions?
In all the illustrations of win-back offers, I see an example of "Get 3 months off, then $X/month", as seen below. First, I'm not exactly clear how each configuration translates into an actual offer in practice: If I want to offer 3 months off on an annual subscription, ie. only if the user pays for the annual offer (basically a 25% discount), is that possible? If I set a "Free" type, of 3 months, I guess that would allow the user to cancel before paying for the annual, correct? If I set a "Pay up front" type, with a 25% discount, how would that show up to the user on the App Store? Secondly, is eligibility to an offer determined by the user elapsing on the same subscription or any subscription in the same subscription group? Thank you
0
0
296
Jan ’25
Handling failed transactions in Storekit 2
When simulating a Storekit error like an invalid device verification or others of that type, should we finish a failed transaction? When I test with a Storekit configuration file, all failed transactions persist after every restart. The Apple-provided sample code for Storekit 2 has transactions finished only when they are successful.
0
0
182
Jan ’25
Subscription Renewals in TestFlight Sandbox Testing
What happens after 12 renewals? Does the subscription expire completely? The next day when I try to manage settings for my sandbox account it says it cannot connect. I cannot see the status of subscription in: Settings-> App Store -> Sandbox Account -> Manage Logging out and logging in of my regular account does not fix that. When I login with a different non-testflight sandbox account I can finally edit those settings. There are some missing details in documentation explaining testflight sandbox accounts. Do these accounts stop working after 12 auto-renewals? I need more specific details in order to ensure subscriptions will work properly during production.
1
1
487
Jan ’25
Transaction.Id from Product.Purchase is different from the transactionId notified by the server notification
Hi, In an auto-renewable subscription scenario, I receive a transaction from Product.Purchase and then send the transaction ID (e.g., 500000000738201) to my API server. After receiving the response, I called transaction.finish(). The account has purchased the subscription before and expired. So it's re-subscribe. And then, I received a RESUBSCRIBE notification from Apple’s server to my API server. I noticed a discrepancy where the transaction ID in the notification is decreased by one (e.g., 500000000738200 instead of 500000000738201). I’m wondering why this discrepancy occurs and how it happens. Best regards, RoyHuang
0
0
253
Jan ’25
Business model changes by using the app transaction
Hello, I’m trying to change my business model within the app, and following Apple’s documentation guidelines HERE I created this task in the main view of the app. It seems to work perfectly in the simulator, on physical devices, and on TestFlight. However, after releasing it to production and uploading the new version to the App Store, it doesn’t work, and all users, whether new or existing, are asked to subscribe. In the console, it appears to retrieve the transactions correctly, but in production, I’m not sure how to view the console or see what it’s retrieving. Here the sandbox receipt I obtained AppTransaction.shared obtained: { "applicationVersion" : "1", "bundleId" : "com.anestesiaIB.Drugs-Infusion-Calc", "deviceVerification" : "6M0Nnw14nSEOBVTPE\/\/EfnWSwLm7LFSlrpFEwxgH74SBHp5dSzBEm896Uvo42mwr", "deviceVerificationNonce" : "8a8238c0-0aee-41e6-bfb0-1cfc52b70fb6", "originalApplicationVersion" : "1.0", "originalPurchaseDate" : 1375340400000, "receiptCreationDate" : 1737577840917, "receiptType" : "Sandbox", "requestDate" : 1737577840917 } This are the processing log while verified the receipt New business model change: 1.7 Original versionéis components: ["1", "0"] Major version: 1, Minor version: 0 This user is premium. Original version: 1.0 This is my task... .task { do { let shared = try await AppTransaction.shared if case .verified(let appTransaction) = shared { let newBusinessModelVersion = (1, 7) // Representado como (major, minor) let versionComponents = appTransaction.originalAppVersion.split(separator: ".") if let majorVersion = versionComponents.first.flatMap({ Int($0) }), let minorVersion = versionComponents.dropFirst().first.flatMap({ Int($0) }) { if (majorVersion, minorVersion) < newBusinessModelVersion { self.premiumStatus.isPremium = true isPremium = true } else { let customerInfo = try await Purchases.shared.customerInfo() self.premiumStatus.isPremium = customerInfo.entitlements["premium"]?.isActive == true isPremium = self.premiumStatus.isPremium } } else { print("Error: obteining version components") } } else { print("Not verified") } } catch { print("Error processing transaction: \(error.localizedDescription)") } }
0
0
306
Jan ’25
I don't understand apple store server to server notification
Hello, I'am trying to validate a new app from apple. I have configured sandbox url and production url for server to server apple store notification. I have created subscriptions product id, but there are no validated yet by apple. When I upload my app to testflight, I can't test sandbox notification cause the product id are not available, on local xcode with storekit file I got my product Id but I don't receive notification. So my question is how can I test there thing. I have to produce fake product id ? I'm lock its very complex process, I don't understand. I tried to send my app like that for verification but the team told me to use receipt, but its deprecated and notification webhook is better for me. What is the good order, validate my subscription product ID then test ? what is the good steps. Apple seems to don't want validate my subscription product ID I'm lock..
0
0
299
Jan ’25
Skipping In-App Subscription
We currently have an app that contains a monthly subscription to unlock the main functionality. We would like to have a way for our employees to be able to use the app without having to go through this mechanic. For instance, our sales associates and our support staff. I had previously made a promo code field which would check the value with an API to determine whether to validate the subscription or not, but the app was denied since it didn't use the IAP system, which I understand. I'm aware that I could somewhat achieve this behaviour through the use of promo codes, but that would require us to create a new batch of codes periodically, not to mention that every employee would need to have a payment method setup in their device, which we would like to avoid. We could also periodically issue TestFlight builds to bypass this, but once again it's not an ideal solution since it necessitates some periodic and perpetual management. Is there any way I can achieve this while following the App Review Guidelines?
0
0
234
Jan ’25
In-app purchases fail: "Password reuse" error?
I'm trying to implement my first in-app purchase, and I've created the IAP in App Store Connect, and created a sandbox account. When I open Settings > Developer in the iPhone Simulator, there is a "Sandbox Apple Account" option at the bottom. If I click the blue "Sign In" link I'm asked for the email and password, so I enter the correct credentials for the sandbox account. The "Sign In" text goes grey for a few seconds, then it goes blue again. It never changes to show that I'm signed in. Should it? (I think so.) Do I need to sign into the Simulator's Apple Account, too? (I don't think so.) Anyway, aside from that, in my app the IAP is listed and I have a button to purchase it. When I click it I'm asked for the email and password to sign into the Apple Account. I enter the correct sandbox email and password (they are definitely correct) and I see this in the Xcode console: Purchase did not return a transaction: Error Domain=ASDErrorDomain Code=530 "(null)" UserInfo={client-environment-type=Sandbox, NSUnderlyingError=0x600000d0c7b0 {Error Domain=AMSErrorDomain Code=100 "Authentication Failed The authentication failed." UserInfo={NSMultipleUnderlyingErrorsKey=( "Error Domain=AMSErrorDomain Code=2 \"Password reuse not available for account The account state does not support password reuse.\" UserInfo={NSDebugDescription=Password reuse not available for account The account state does not support password reuse., AMSDescription=Password reuse not available for account, AMSFailureReason=The account state does not support password reuse.}", "Error Domain=AMSErrorDomain Code=0 \"Authentication Failed Encountered an unrecognized authentication failure.\" UserInfo={NSDebugDescription=Authentication Failed Encountered an unrecognized authentication failure., AMSDescription=Authentication Failed, AMSFailureReason=Encountered an unrecognized authentication failure.}" ), AMSDescription=Authentication Failed, NSDebugDescription=Authentication Failed The authentication failed., AMSFailureReason=The authentication failed.}}} Why is it talking about password reuse? AFAIK, I have only one sandbox account for this app (and none for any of my other apps), and this is the only one of my apps that has an IAP. Any ideas on how to get an IAP working? Thanks!
4
1
1.9k
Jan ’25
关于.storekit配置文件无法与Apple store Connect同步产品
I have configured the auto-renewable subscription product through Apple Store Connect, made it available in Xcode via the .storekit configuration file, and successfully purchased it in the testing of the old version. However, during the development of the new version, it seems that I mistakenly opened the .storekit configuration file of the old version, and then one or two pop-up windows appeared (the specific content was similar to saving? I don't quite understand), after that, I found that my new version .storekit configuration file could not automatically sync the auto-renewable subscription product from Apple Store Connect. I can't understand what happened here. 我通过Apple store Connect配置好了自动续期订阅产品,将它在Xcode通过.storekit配置文件配置可用,并且在旧版本的测试中成功购买。 但是,在开发新版本的过程中,我似乎错误的打开了旧版本的.storekit配置文件,然后弹出了一个或者两个弹窗(具体内容类似保存?我不太理解),之后,我发现我的新版本.storekit配置文件无法从Apple store Connect自动同步自动续期订阅产品。 我无法理解这里发生了什么问题。
1
0
427
Jan ’25
unable to get subscription products macos iap xcode swift
Hi Apple Support, I am encountering an issue while testing in-app purchases in the sandbox environment. I have created a sandbox tester account Logged out of the App Store and System Settings on my Mac. My main developer account is signed in under Sign In & Capabilities in Xcode. The Bundle ID matches the one configured in App Store Connect. The Product ID I am querying also matches the configuration. Deleting the app and reinstalling. Restarting my Mac. When running my code in debug mode, I observe the following: Running debug build App Store environment: Production [1b294b55] Error updating Storefront: Error Domain=StoreKit_Shared.StoreKitInternalError Code=7 "(null)" Valid products: [] Invalid product IDs: ["com.x.x.x.monthly"] No products found The Product ID (com.x.x.x.monthly) matches the one I have configured in App Store Connect. The bundle id matches. When I create a StoreKit Configuration file in Xcode and sync it with my app, I can see the product IDs correctly. Below are the relevant code snippets for fetching and handling products: func fetchProducts() { guard !productIDs.isEmpty else { print("No product IDs configured") return } let request = SKProductsRequest(productIdentifiers: productIDs) request.delegate = self print("Starting product request...") request.start() } func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) { DispatchQueue.main.async { print("Valid products: \(response.products)") print("Invalid product IDs: \(response.invalidProductIdentifiers)") self.products = response.products if self.products.isEmpty { print("No products found") } else { print("products not empty") for product in self.products { print("Fetched product: \(product.localizedTitle) - \(product.priceLocale.currencySymbol ?? "")\(product.price)") } } } } func debugStoreSetup() { if let receiptURL = Bundle.main.appStoreReceiptURL { if receiptURL.lastPathComponent == "sandboxReceipt" { print("App Store environment: Sandbox") } else { print("App Store environment: Production") } } else { print("No receipt found") } } Could you help identify why my app is not recognizing the Product ID in the sandbox environment? Thank you for your assistance.
2
3
820
Jan ’25
User cannot purchase in app after upgrading iOS system with StoreKit
Several players in our app cannot purchase after upgrading iOS system. They make purchases every day before upgrading. After upgrading, they cannot purchase. User purchase behaviors: cannot request product: no callback received; didFailWithError received: Couldn’t communicate with a helper application . request product success: purchase stuck and after 2 mins failed with error message "There was a problem with your purchase" These players try to make purchases every day. Most of time they cannot get store products with no request callback. These player can make purchases in other apps. players' info: ipad7: 18.1.1 -> 18.2 ipad7: 18.1.1 -> 18.2.1 iPhone13 pro max: 17.6.1 -> 18.1.1 app info: xcode: 15.2 iap: store kit related code: iosIap.m (see the attachment) IOSIAP.m.txt Does any one know how to resolve this issue? Thanks.
1
0
343
Jan ’25
Using Storekit development, unsubscribe and resubscribe callback problem
The app subscription function uses StoreKit. After canceling the subscription, I try to subscribe again and get the following error. I remember it was working fine before iOS 18 was released. { NSLocalizedDescription = "\U53d1\U751f\U672a\U77e5\U9519\U8bef"; NSUnderlyingError = "Error Domain=ASDErrorDomain Code=825 "(null)""; } Hope you can help me solve this problem as soon as possible. Thanks
0
0
270
Jan ’25
Response of the server-side verifyReceipt endpoint when using offer codes
Hi, We use the (now deprecated) server-side receipt verification API (*1) with the app we are maintaining and there are some points I would like confirm on how its response changes based on whether the purchase being processed was a subscription that used an offer code or not. I am particularly concerned about the following: Are there any properties of the response that are added or missing? Is there any property indicating that an offer code was used? If there is, which field is that and what values does it take? Are there any special steps or options required when processing the receipt which used an offer code on the server side? *1 https://developer.apple.com/documentation/appstorereceipts/verifyreceipt
0
0
233
Jan ’25
Is purchase sharing between a family something that can be disabled?
Curious if I can disable the ability for people in the same family to all download my app for free once one person in the family has paid for it. I can't seem to find the setting anywhere. Maybe this is just something that is non-negotiable from Apple's point of view? Seems weird though that this would not be in the hands of the developer to decide if people in a family all need to buy their own app, or if it can be shared with the whole group.
0
0
231
Jan ’25
Unable to sign in to sandbox StoreKit test accounts (iOS)
The error below started today 10/17/2024 (on iOS 18.1 beta 5/6/7 at least) in StoreKit sandbox testing. Outside code/app, I can't even login to the test account in settings->AppStore->Sandbox Account (goes through email/phone confirmation and then silently fails). Tried a different password for a new sandbox test account with no success...Anyone experiencing this? P.S. Status page (https://developer.apple.com/system-status/) shows some related outage from two days ago, but no current problem. Error: Purchase did not return a transaction: Error Domain=ASDErrorDomain Code=530 "(null)" UserInfo={NSUnderlyingError=0x3009ca040 {Error Domain=AMSErrorDomain Code=100 "Authentication Failed The authentication failed." UserInfo={NSMultipleUnderlyingErrorsKey=( "Error Domain=AMSErrorDomain Code=2 "Password reuse not available for account The account state does not support password reuse." UserInfo={NSDebugDescription=Password reuse not available for account The account state does not support password reuse., AMSDescription=Password reuse not available for account, AMSFailureReason=The account state does not support password reuse.}", "Error Domain=AMSErrorDomain Code=306 "Reached max retry count Task reached max retry count (3 / 3);" UserInfo={AMSDescription=Reached max retry count, AMSURL=..., NSDebugDescription=Reached max retry count Task reached max retry count (3 / 3);, AMSFailureReason=Task reached max retry count (3 / 3);, AMSStatusCode=200}" ), AMSDescription=Authentication Failed, NSDebugDescription=Authentication Failed The authentication failed., AMSFailureReason=The authentication failed.}}, storefront-country-code=USA, client-environment-type=Sandbox}
9
4
1.8k
Jan ’25
Taxes: Do you need to do taxes for each country your app is offered in?
Hi, First year receiving revenue through Storekit subscriptions. I live in the United States and know I need to pay taxes within the U.S. for my revenue. I'm curious if I have to handle anything (taxes, etc) in each country I sold a subscription in or does Apple handle all that for me? If it's a per-country basis is there a list somewhere so I can use it to choose where I should offer my app in the future? Thanks everyone!
1
0
421
Jan ’25