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

SubscriptionStoreView does not list a promoted subscription
Hello, I am using SubscriptionStoreViews to list 2 subscriptions, both in the same group.. a monthly subscription and a six monthly subscription. Both work and appear in the list presented by SubscriptionStoreView. However when I go to AppStore Connect and select the six monthly subscription to be a promoted subscription, it can now be selected and purchased on the AppStore but no longer appears in my SubscriptionStorekit View. Is this expected behaviour and should I create a duplicate six month subscription which is not promoted, or is there a better solution? Many thanks
1
0
55
1d
Error 21002 - Validating Receipts Server-Side
Hi! I am creating a plugin that implements the In App Purchases and Subscriptions. I have done everything already and the only error I am debugging right now is with the validation of receipts. I always get status 21002 even the format is base64 already. I prefer to use the verifyReceipt as it is intended for my plugin. I have tried everything but still the response I get is status 21002 which is I know the data in receipt-data is malformed or missing. What can I do about this? Thank you so much in advance! This is my code too: (Objective-C) NSString *receiptString = [receiptData base64EncodedStringWithOptions:2]; if (!receiptString) { [self post_receipt_validation_result:@{@"status": @"error", @"message": @"Failed to encode receipt data"}]; return; } NSLog(@"Requesting to Sandbox: %@", receiptString); NSURL *storeURL = [NSURL URLWithString:@"https://api.storekit-sandbox.itunes.apple.com/verifyReceipt"]; NSMutableURLRequest *storeRequest = [NSMutableURLRequest requestWithURL:storeURL]; [storeRequest setHTTPMethod:@"POST"]; [storeRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; NSDictionary *requestContents = @{@"receipt-data": receiptString}; NSError *jsonError; NSData *requestData = [NSJSONSerialization dataWithJSONObject:requestContents options:0 error:&jsonError]; if (jsonError) { [self post_receipt_validation_result:@{@"status": @"error", @"message": jsonError.localizedDescription}]; return; } NSLog(@"Request Data: %@", requestData); [storeRequest setHTTPBody:requestData]; NSLog(@"Store Request: %@", storeRequest);
0
0
41
1d
App freezes on purchase: StoreKit and fullScreenCover
My SwiftUI app freezes when completing a purchase in StoreKit if I have .fullScreenCover modifier applied anywhere in the View hierarchy. It doesn't matter where I put the .fullScreenCover modifier in the view hierarchy. Even if I place it somewhere else in the hierarchy and don't trigger it, the app will still freeze on completed purchase. As soon as I remove .fullScreenCover modifier everything works great. Anyone else had this issue? Is this a known issue? Is there a fix for this? struct ShopView: View { @EnvironmentObject var store: Store @State var isFullScreenCoverPresented: Bool = false @State var purchasedTip: Tip? = nil var body: some View { VStack { VStack { ForEach(store.products.sorted(by: { $0.price < $1.price })) { product in ProductView(product) { Image("productImage") } } } } .onInAppPurchaseCompletion { product, result in if case .success(.success(.verified(let transaction))) = result { await store.process(transaction) // make sure there's a Tip corresponding to the purchased product if let tip = Tip(rawValue: product.id) { purchasedTip = tip } // show thank you note in full screen cover isFullScreenCoverPresented = true } } .fullScreenCover(isPresented: $isFullScreenCoverPresented) { if let tip = purchasedTip { ThankYouNote(tip: tip) } } } }
1
0
30
1d
In-app purchases products for marketplace items
We are programming a marketplace for digital artwork, which shall use in-app purchases. Are we allowed/supposed to create only one storekit product, which we can call "item-x" and assign a fix price of i. e. 5,00$, assuming all items are sold for 5,00$, and use this product for all items? Or shall we create one product for each item which is selled on or platform, which could be 1.000?
0
0
87
3d
Please explain the Get Transaction History API
There are several auto-renewable subscriptions with the same 'webOrderLineItemId' value. (The 'originalTransactionId' value is the same and 'transactionId' is different.) If you look up the History API based on 'originalTransactionId', you can see that only one auto-renewable subscription with the same 'webOrderLineItemId' value is viewed. What is the criteria for looking up? I searched History API based on 'originalTransactionId' value. However, auto-renewable subscriptions that do not match 'originalTransactionId' are also being viewed in response. What is the reason? https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history
0
0
62
3d
Please explain about ConsumptionRequest Properties
platform: Please let me know which platform 'Non-Apple platform' is referring to. For example, Google or Amazon? And is it correct to mean the platform that consumed the products received due to in-app purchases? playTime: Does 'playTime' mean the time when the customer purchased the app and actually accessed the app? Or do you mean the time you accessed after the in-app purchase? lifetimeDollarsPurchased/lifetimeDollarsRefunded: If the app has multiple accounts for that customer, is the purchased/refunded amount for all accounts?
0
0
75
3d
Converting Mac App from Paid to Freemium (Price Change)
I currently have a paid app in the Mac App Store and am about to release a freemium version - free with three auto-renewing subscriptions. Is there a way to set things up in App Store Connect such that this next release of my app becomes free at the point when it goes live? I need to synchronise the changeover. I've read posts suggesting you just set the price to zero, but that doesn't synchronise the change (as far as I can tell). Thanks in advance. UPDATE: I see you can schedule a price change. Is the answer to not auto-release the app when it's approved, and to then coordinate its release date with the scheduled price change?
0
0
91
3d
购买订阅型商品 transactionIdentifier 不在 receiptDataText里面
购买订阅型商品,为什么回调给苹果客户端的 SKPaymentTransaction.transactionIdentifier 不在从票据验证返回的receiptDataText(票据字符串)数据集合里 苹果客户端获取到的: SKPaymentTransaction.transactionIdentifier 苹果支付回调返回的id NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL]; // 票据URL NSData *receiptData = [NSData dataWithContentsOfURL:receiptURL]; //票据二进制 NSString *receiptDataText = [receiptData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed]; //票据字符串
0
0
112
5d
Tesflight eCommerce error, Beta testers outside the US, for our MacOS App, are being told their ID is not valid in the US Store
Beta testers outside the US, for our MacOS App, are being told their ID is not valid in the US Store and that they must switch to a store in their country. Yet the store switch fails Essentially beta testers outside the US cannot do testflight sandbox eCommerce for the Mac version of our app. Note that eCommerce on the Mac works for US based testers and eCommerce for the iOS/iPadOS works for testers in all territories. Many of these testers are in India, the UK and Canada. We believe that this is incorrect, that storeKit is not correctly detecting the AppStore Region for mac based testflight eCommerce. At this point we have 382 testers, most outside the US and we can only Beta Test our app with US users. Attached are images of the messages that are coming from storeKit: Here is a link to a video from a user in Canada who is demonstrating the problem (cut and paste into browser) https://youtu.be/kB818wfVld4 Here is another link to a video from a user in Canada who is demonstrating the problem (cut and paste into browser). https://youtu.be/7uAZKo8wpfU We see that there is another post with a similar problem. Similar eCommerce Problem Because eCommerce works in all territories on iOS/iPadOS but ONLY in the US for Mac we suspect that this is an error that either a DBA or a coder will need to fix. Any insights from anyone would be appreciated.
3
0
184
7h
Questions about ConsumptionRequest properties
Hello. platform: Please let me know which platform 'Non-Apple platform' is referring to. For example, Google or Amazon? And is it correct to mean the platform that consumed the products received due to in-app purchases? playTime: Does 'playTime' mean the time when the customer purchased the app and actually accessed the app? Or do you mean the time you accessed after the in-app purchase?
1
0
127
4d
How the app behaves when an AccountNotFoundError is returned by the App Store Server API.
We are currently implementing in-app purchases with auto-renewing subscriptions. If an AccountNotFoundError is returned from the App Store Server API, is it correct for the app to stop the service offered with that subscription? The documentation does not go into detail, so I am just checking to be sure. https://developer.apple.com/documentation/appstoreserverapi/accountnotfounderror
0
0
115
1w
“Account Not In This Store” error when trying to purchase non-consumable IAP within TestFlight
I have simple non-consumable IAPs set up for an app on macOS. Testing in development with a local .storekit configuration file, everything works as expected. Testing in development with a remote Sandbox, everything also seems to work fine. Product names and prices fetch correctly, I am able to make purchases with a Sandbox account (both US and UK). Once I upload a build into TestFlight, IAPs no longer work. The tester would download the Beta app from TestFlight. They open a license manager and can see all the product names, descriptions and prices are pulled from Apple servers correctly (with the correct local currency as well!). So far so good. When trying to purchase any of the IAP, the following error appears: This is TestFlight so testers are using their real Apple ID. My understanding is that they should continue using their production credentials and a TestFlight Sandbox would be configured behind the scenes automatically. This error always says the users cannot purchase from a US store and must switch to [whatever user’s actual store location is] store. For example, my account is based in the UK, has got a UK billing address and a UK payment method, and the error tells me to switch to the UK store. People in Canada get a similar error - you must switch from the US store to Canadian. The error makes no sense, the account is already in the desired country. Clicking on the “Change Store” button opens the App Store app and displays another error: “Cannot Connect to App Store”. Clicking Retry just results in this errors showing again and again. Clicking OK takes us back to the failed IAP purchase and the final error message appears: “Purchase Error - Unable to Complete Request”. Things I’ve done / checked: IAPs are configured in App Store Connect and available for all regions prices are set for all regions in App Store Connect IAP name and description localisation in English (UK) IAP status is Ready to Submit, I don’t think I can go past that unless I make a production release (which I can’t until we fix the problem) IAP capabilities added in xcode the problem is not account, machine, or location dependent - every beta tester testing my app on TestFlight has the same issue, they each use a different account and have accounts in different countries double checked the App Store account location in the App Store settings - it is definitely matching the store this error is asking to switch to application exits at startup with error 173 if app receipt cannot be found - this one was suggested by the review team, I could not really find any documentation for it review team also suggested I should add com.apple.security.network.client to enable IAP connectivity. I did add that to one of the builds and it did not help. I am not really convinced this is necessary Any suggestions on what to check and what to try? I have run out of ideas.
3
4
217
5d
Use personal Reduction Code in apple ios application ?
Good morning, I am in the process of setting up a new release of my application, in fact I recently submitted a release using stripe as a means of payment for subscriptions which was refused by telling me that it must go through Apple IAP. Currently everything has been migrated to IAP, my subscriptions are offered by period (1 month, 6 months, etc.), and with discount vouchers that I manage until now with my server (managarial/marketing choice). The approach used to manage this is to offer two subscriptions on Apple Connect for each period: for example 1 month => there is one subscription with $3 and one with $2. With respect to my server verifications (has the user validated their discount voucher or not), I display the appropriate subscription to them. Could you please tell me that this approach will not impact me on my next review? while knowing that currently all subscriptions now go through IAP Apple and my work on the server side only manages the display of the appropriate products and whether or not the user has validated their reduction voucher. Tank you.
0
0
202
2w
Subscription Unavailable - Strange Behavior with StoreKit
I added my first subscription to my app using StoreKit's SubscriptionStoreView. Everything worked as expected in the debug environment and also in TestFlight. So I submitted my app and subscriptions to App Store Connect, got everything Approved and released. After updating my app through App Store and checking the Subscription View, it just says "Subscription Unavailable. The subscription is unavailable in the current storefront." I waited around 3 days and still getting the same message. Now the very strange behavior starts. I went to App Store Connect, I made and edit to the subscription description, saved, removed the edit, saved, and submitted to review. 15 minutes later the subscriptions appear in my app and everything works as expected. After getting the edit approved, the Subscription View in my app again only showed the message "Subscription Unavailable. The subscription is unavailable in the current storefront." No user is able to see the subscriptions anymore, even though it worked as expected before the edit was approved. So I did the same as before. Again, make an edit to the subscription description, save, remove the edit, save, submit to review. 15 minutes later the subscriptions are again available in my app and it works as expected. This is definitely not the expected behavior and submitting the subscription edits every day is wasting the App Review Team's time as well as mine. I contacted Apple Developer Support but I didn't get any reply back (at least yet). I am not the only one experiencing this. I found a friend online who has the exact same issue, and is able to temporarily solve it by making an edit to the subscription description as well. So far it has been a huge headache, and we are losing customers this way. Please if anyone has experience with this problem, or has any suggestions, they will be greatly appreciated. Thank you so much, Tomas
6
6
369
3d
Test Flight build does not show Purchase Confirmation popup for IAP.
Hi, We are seeing a small issue on our app with a subscription in app purchase and wondering whether this should be a cause for concern. We have 2 subscription based IAPs and 1 consumable within the app. I recently noticed that after buying one of the subscriptions and cancelling it if I try to buy the product again, it skips the purchase flow on our Test Flight builds. I added some logs, and it appears that Product.purchase() returns right away and the resulting transaction also comes back as verified, but the new purchase is not added to current entitlements. I managed to get the flow working after I logged out from my Sandbox account from settings, but after I did another subscription cancellation, I could not purchase the product anymore. This only happens on our Test Flight builds. If I launch the app through Xcode and use a store kit configuration file at launch, I get the purchase popup every time I try to buy the product. It also appears to me that this only happens on a product that I have purchased previously. For the other subscription that I have not purchased before the popup shows up every time. Is this something that we should be concerned about and is there a way to make sure the purchase popup shows up every time? Thank you. Kind regards, Fardin
0
0
117
2w
"account not in this store" error when testing inApp purchase
I've already done my test on development signed app locally, all in-app purchase runs well with sandbox tester Apple ID. Errors happens when make a purchase in distribution app from TestFlight. Detail Info: in Apple Store connect , make app available to China Electron project, packaging by electron builder using distribution sign upload to TestFlight, invite myself to test using my Apple ID(not the sandbox tester) to login and purchase dialog appears and said "Account not in this store" VPN is off Apple Store shows Chinese language and Chinese apps, not llikely to be u.s. store I'm suspecting that: Maybe shouldn't use my developer Apple ID to run TestFlight test? TestFlight locked app to be in u.s. store ?
3
0
267
5h