StoreKit

RSS for tag

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

StoreKit Documentation

Posts under StoreKit tag

328 Posts
Sort by:
Post not yet marked as solved
1 Replies
37 Views
I currently have a subscription-based app where users pay for access to premium features. However, in the upcoming update, I would like to make all features free for all users. My question is, how can I handle the existing subscribers who have paid for the app? What steps should I take to cancel their current subscriptions and ensure they can access all features without any additional charges? I want to ensure a smooth transition for my existing users and avoid any confusion or inconvenience during this transition. Any guidance or best practices on how to handle this situation would be greatly appreciated. Thank you in advance for your help!
Posted
by homiFox.
Last updated
.
Post not yet marked as solved
1 Replies
75 Views
Hi team, I tested the purchase flow under different country. I logged in store sandbox as a Japan account. I can get the product list result which shows $1200 monthly which match the price mapping in AppStore console even my App only enabled Canada and United State in Appstore connect . Purchase this product is also success in sandbox. why purchase is success can you help me understand what else we need to do ?
Posted
by ram999.
Last updated
.
Post not yet marked as solved
1 Replies
109 Views
The app sells non-consumable in-app purchases. I also checked to enable family sharing. However, there are frequent cases where users share purchases using the family sharing function and fail when attempting to purchase or restore from a device of the shared account. Or, if a user who received the sharing makes a purchase, it will not be processed as shared payment information, but will be paid with the payment registered with the Apple ID of the current device. I used StoreKit2 and use Transaction.currentEntitlements to get payment info after purchase or restore. However, non-consumable in-app purchase information that has been shared with the family does not arrive normally. When I looked at the Storekit2 documentation, I know that there is nothing special handled or added in the API or code related to family sharing. If I'm wrong on this part or if you know a good solution to this non-consumable payment - family sharing, please advise.
Posted Last updated
.
Post not yet marked as solved
1 Replies
270 Views
Hi We are adding subscriptions auto-renewable in our app. Subscription will be one month, auto-renewable. We are testing in sandbox. Results of Transaction.currentEntitlements and Transaction.all are sometimes not available : for example, we buy a subscription, we always well receive the hook sent (responseBodyV2DecodedPayload is correct), so subscription is active BUT when we ask Transaction.currentEntitlements, result is no subscription available, neither to Transaction.all (for this one, last transaction is not present) - this problem happens in around 20% of tests. possibly, once the auto-renew is done (5 minutes later, because of sandbox) everything works fine OR not Is it possible that in sandbox, behavior is a bit "random", not 100% safe ? Thanks for any help :)
Posted
by adelrue.
Last updated
.
Post not yet marked as solved
0 Replies
47 Views
I don't know how this happened or how to reset this, but I can't test the StoreKit part of my TestFlight app anymore. When I try to retrieve or buy products (IAPs), I get all kinds of strange behavior. I think it is caused by storekitagent thinking the app is in "Xcode sandbox environment". One of the errors from storekitagent looks like this: [51852D62] [LoadSubscriptionStatusTask]: Subscription status request failed with error - Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={AMSStatusCode=0, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <468756B3-DA53-4FED-B35C-E093954C27D8>.<1>, NSErrorFailingURLKey=http://localhost:49828/inApps/subscriptions?guid=98DD60024C21&reason=push, _kCFStreamErrorDomainKey=10, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <468756B3-DA53-4FED-B35C-E093954C27D8>.<1>" ), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=http://localhost:49828/inApps/subscriptions?guid=98DD60024C21&reason=push, NSUnderlyingError=0x122f638d0 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: lo0, _kCFStreamErrorCodeKey=-72000, _kCFStreamErrorDomainKey=10}}, _kCFStreamErrorCodeKey=-72000} It looks like it's trying to connect to a local server instead of contacting Apple's App Store servers. I'm on the latest macOS and Xcode. Any help is greatly appreciated:) Thanks!
Posted
by nniko.
Last updated
.
Post not yet marked as solved
1 Replies
76 Views
Here is the code, I tried two ways to make a test, pids = [ "me_xxxxxxxx_xxxxxxxx_sub_pro_yearly" , "me_xxxxxxxx_xxxxxxxx_sub_pro_lifetime" ] L.d { "Requesting products from apple: \(pids)" } let appProducts = try await Product.products(for: pids) What's wrong with the code I copied from Apple Store Document? The product info was configed on Apple Store Connect, and it's waiting to commit now. It proved that the configuration of product is fine. I tired to use XCode storekit configuration to request product info, It also works fine. So, I don't know why? Here is detail of the log, Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={NSUnderlyingError=0x280303c00 {Error Domain=AMSErrorDomain Code=1 I logged Sandbox account in iPhone (Setting-Apple Store-Sandbox). It used to work well and I even made a purchase. But with no reason, it doesn't work any more! And yesterday, I was even unable to log in the Apple Store Connect suddenly with no reason. And I contacted you for support, not work. Few hours later, it worked as usual.
Posted
by Boarteng.
Last updated
.
Post not yet marked as solved
0 Replies
61 Views
Is there a way to get a transaction by the transaction ID? I understand that there is a way to get the latest transaction for a specific product ID, but that isn't helpful when attempting to look up a specific transaction. The reason for this is that once a purchase is made and verified on the client device, a request is made to a backend server to do some extra validation and to provide the user with the required entitlement for that purchase. Once the server completes this, it responds to the client, and the client app needs to look up the transaction in order to call finish() on it. Would it make sense to get the unfinished transactions and loop through them to match the required transaction ID? What I'm referring to is this: https://developer.apple.com/documentation/storekit/transaction/3856631-unfinished Another question, is it possible for there to be more than one unfinished transaction for the same product?
Posted
by rhdr.
Last updated
.
Post not yet marked as solved
5 Replies
620 Views
Hi, I'm trying to locate the app store receipt in the apple watch in order to send it to my server to verify. I'm using the Original API for In-App Purchase because my app needs to support watchOS 7.0 My watchOS app is an independent app still pending to release to App Store. I'm testing using TestFlight, and I have one-month subscription in state "Ready to submit". The process of purchase finishes fine in the apple watch -sandbox success screen- but then, when I invoke SKReceiptRefreshRequest in order to ask Apple for the Bundle.main.appStoreReceiptURL to download in my device and send it to my server to verify, I always get the following error: <SKReceiptRefreshRequest: 0x16df52c0>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=507 "Invalid container for application: file:///private/var/containers/Bundle/Application/8BAF3B0E-45FC-465A-92E2-CFB1507A33E1/IvooxAppleWatch%20WatchKit%20App.app/PlugIns/IvooxAppleWatch%20WatchKit%20Extension.appex/" UserInfo={NSDebugDescription=Invalid container for application: file:///private/var/containers/Bundle/Application/8BAF3B0E-45FC-465A-92E2-CFB1507A33E1/MyApp%20WatchKit%20App.app/PlugIns/MyApp%20WatchKit%20Extension.appex/} And the receipt isn't there, in the path Bundle.main.appStoreReceiptURL. I tried looking for both receipt and sandboxReceipt. No luck. I even tried to list the contents of StoreKit but that directory does not exist on my watch according FileManager. I cannot get rid of the error above. Any help is highly appreciated. Thanks in advance.
Posted Last updated
.
Post not yet marked as solved
1 Replies
88 Views
So trying to release a new (iOS/iPadOS) app and I'm in endless rejection purgatory trying to get it approved along with its first In App purchase product (an auto-renewable subscription). This is the final issue holding back the release and I do not know how to get out of this rejection loop. First, yes, In App purchase works fine when testing in the sandbox environment. My In App purchase infrastructure is based on the well-regarded StoreHelper Swift package and works great in all my testing. The rejection is based on the fact the "store" in my app always displays an empty products list when Apple reviews the app. Of course, since they haven't approved my lone subscription product, which has a status of 'Waiting for Review' I'm not surprised they see an empty store, but Apple is apparently surprised and refuses to stop being surprised. All they do is toss a link to the StoreKit documentation at me. So I pore over it looking for clues. Hmm. Hmm. Yeah I know this, I do this, what are you not telling me? So I'm climbing the walls trying to figure out if indeed I'm overlooking something. Apple, like a pedantic college professor, apparently wants me to figure out on my own. Well I can't. I can't find the secret handshake. So questions: When I create my .storekit configuration file I do so by syncing with my App in App Store Connect. This works dandy, but do I or do I not include this configuration file with the distribution build I submit for review? I can't find any info on whether this is only for testing or for both production and testing, and since I have to manually add it to my project after creating it, I worry that's not how it's intended to be used. So do I add the .storekit bundle to my app target and leave it there during distribution? (Note: I already do so, wondering if I should not) Since I'm using fastlane to produce and upload my builds, how can I be sure this StoreKit Configuration is being set correctly (right now I use the pop-up in the Options tab of my Release scheme)? Does it even need to be set when distributing? I assume so. Apple has this strange ambiguous language about "your first In App purchase must be submitted with a new build". Well, early on there was indeed a way to add my not yet approved Subscription product with the build review request, but now that's gone. So I have this subscription product sitting in "Waiting for Review", I have my working app that can't get approved because it can't see the not yet approved subscription product. Though maybe it can't see it for reasons other than it's not approved yet. Do I just... wait and hope Apple eventually moves my Subscription product to an approved status and submit again? At my wits end as this is now rejection round 6. I've heard horror stories of similar first In App purchase doom loops going a dozen or more rejection rounds. Developing the app was hard enough but to be stuck in this maddening bureaucracy is killing me. Many thanks in advance!
Posted Last updated
.
Post not yet marked as solved
0 Replies
96 Views
I understand we do not get to know if SKStoreReviewController(SKSRC) was show and how the user interacted with it. Is system(iOS/iPadOS) putting checks in place so that in same app version, SKSRC is not shown to a user again if user has already rated(or rated + reviewed) the app earlier in same version via SKSRC? If system can show SKSRC again to users who have rated( or rated + reviewed) in same app version then in the 2nd instance of SKSRC will the rating stars and the review be pre filled with first instance SKSRC response?
Posted Last updated
.
Post not yet marked as solved
12 Replies
5.6k Views
I'm using TestFlight to test an app with payment/subscription functionality. I created sandbox accounts in AppStore Connect accordingly to be able to test the subscriptions. I'm logged in with the sandbox account. When I try to subscribe in the App the wrong account (this is my actual real AppleID) is used for the subscription although it is recognized that this is just a sandbox subscription. I tried: logging off/on into the sandbox account creating a totally new sandbox account trying to trigger the payment with no logged in sandbox account The result is always: in the payment popup it is stated that the purchase account will be my original AppleID and not a sandbox account. How can I switch the accounts? Is this a bug at Apple's side somehow?
Posted
by fwuen.
Last updated
.
Post not yet marked as solved
0 Replies
71 Views
I’m trying to build a simple app that will allow users to create items in-app and buy/sell access to them. Users can buy tokens from the App Store that can be used to fund these purchases (e.g. 1 token = 100 coins), and can also be used support the development of these items (e.g. give creator 1 coin a week). The creators can then cash out the coins once a certain amount is reached, via Stripe or some other external payment provider. Is this allowed under the current rules of the app store? Is it possible to implement using CloudKit? If this isn’t allowed, is it possible to allow users to share content on the app’s “store” for other users to browse and download, and can that be done just using CloudKit? This is my first-ever app and I don’t know left from right when it comes to back-ends. I will greatly appreciate any pointers.
Posted
by wmk.
Last updated
.
Post not yet marked as solved
0 Replies
85 Views
I'm currently working with SKOverlay in my iOS app and I'm trying to track user clicks on the overlay. I've explored a few solutions but haven't been able to find a reliable method for capturing these clicks. I would appreciate some guidance or suggestions on how to achieve this. Any advice or code examples would be greatly appreciated. Thank you in advance for your help!
Posted
by Dhaker.
Last updated
.
Post not yet marked as solved
1 Replies
132 Views
I've got an app live in the App Store, and a second app that I'm developing right now. In TestFlight (only!), when I display a manageSubscriptionsSheet in the new app I'm seeing the TestFlight subscription status for the other app. If I run the new app on the same device in debug mode (connected to my laptop), I get the correct manageSubscriptionsSheet displayed. In both environments (Debug and TestFlight) I see the correct purchase sheet showing the right subscription options. It is only the manageSubscriptionsSheet that is incorrect. Both the new app and the old app (the one showing up in manageSubscriptionsSheet) have TestFlight builds on my phone. Of course, as I type this up I reinstall the TestFlight build (after seeing the correct manageSubscriptionsSheet in the debug build) and now I'm seeing the correct manageSubscriptionsSheet. Is this something I'm doing wrong in my app, or is this a known issue with TestFlight apps? I know it's expected that the entitlements are different on TestFlight than in debug, but would manageSubscriptionsSheet show something different than a purchase sheet?
Posted Last updated
.
Post not yet marked as solved
1 Replies
103 Views
I got this error while fetching products using storekit 2 in swiftui. 2023-05-23 12:19:51.196042+0530 SKDemo[1183:172700] [Default] Error enumerating unfinished transactions for first transaction listener: Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={client-environment-type=Sandbox, storefront-country-code=AUS, NSUnderlyingError=0x2812e0210 {Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/history?REDACTED, AMSStatusCode=500, AMSServerPayload={ errorCode = 5000001; errorMessage = "An unknown error occurred. Please try again."; okButtonString = OK; }, NSLocalizedFailureReason=The response has an invalid status code}}} 2023-05-23 12:19:58.672549+0530 SKDemo[1183:172693] [Default] Error enumerating all current transactions: Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={NSUnderlyingError=0x2812d5f50 {Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/history?REDACTED, AMSStatusCode=500, AMSServerPayload={ errorCode = 5000001; errorMessage = "An unknown error occurred. Please try again."; okButtonString = OK; }, NSLocalizedFailureReason=The response has an invalid status code}}, storefront-country-code=AUS, client-environment-type=Sandbox}.
Posted
by rasterdev.
Last updated
.
Post not yet marked as solved
2 Replies
135 Views
Good morning, we have a backend making calls to the subscriptions API to check the status of users subscriptions. Now, besides the check we need sometimes to extend subscriptions, using the api: https://api.storekit.itunes.apple.com/inApps/v1/subscriptions/extend/{originalTransactionId} To call this api we need a signed JWT Token and the originalTransactionId. Now, calling the api with the concrete parameters we receive always error response like this: StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers: { Date: Wed, 17 May 2023 14:48:36 GMT Server: Apache Strict-Transport-Security: max-age=31536000 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block Content-Security-Policy: default-src 'self' *.apple.com; X-Content-Type-Options: nosniff Content-Length: 196 Content-Type: text/html; charset=iso-8859-1 }; content is 404 Not Found Not Found The requested URL was not found on this server. Consider that the originalTransactionId is taken from the response of a previous verifyReceipt API, and the error does not seem related to the authentication (so I tend to exclude issues with the signed token) What could be the problem? What is the right way to extend a subscription via API call? Thank you.
Posted
by sarmenia.
Last updated
.
Post not yet marked as solved
2 Replies
392 Views
Hello! I am working on a reader app that supports 4 languages: Danish, Finnish, Norwegian, and Sweeden. The content's language is either the phone's preferred language, if it is one of the 4, or is chosen by the user on the first app start. As per Apple's guideline, I implemented the ExternalLinkAccount flow, and for localizing the URL I added SKExternalLinkAccount into the Info.plist file. For debug purposes, the default URL is google.com. This is how it looks: <dict> <key>dk</key> <string>https://historienet.dk/abonnement</string> <key>fi</key> <string>https://historianet.fi/tilaa</string> <key>no</key> <string>https://historienet.no/abonner</string> <key>se</key> <string>https://varldenshistoria.se/prenumera</string> <key>*</key> <string>https://google.com</string> </dict> I have a question and a problem: The problem is that on iOS 16+, the URL opened after pressing the Continue button on the ExternalLinkAccount sheet is always the default one, regardless of the app's and phone's language and region. On what does it rely to display the localized/regional version of the URL? For debugging it, I tried obtaining the Norway or Sweedan URL on the simulator by changing the app's language and region from the scheme, the simulator's language and region from Settings, and tested it on a real device with the region and language changed to Norway/Finland using a TesFlight build. I had no success. Can I control/influence which region is selected? Because the user can select a language for the app content, it would be ideal to reflect it on the URL opened by the ExternalLinkAccount flow.
Posted
by roxanaSt.
Last updated
.