StoreKit

RSS for tag

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

StoreKit Documentation

Post

Replies

Boosts

Views

Activity

购买订阅型商品 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
28
3h
Testing Multiple In App Purchases in Unpublished App
I am a new app developer. I successfully tested my first in app purchase to remove ads. I then tried to include a consumable, but every time the app reads the available list, I get an error for that one. I can't seem to find a solution somewhere and wonder if this is a problem that might happen with testing an unpublished app. Here is the relevant snippet of code as well as a screenshot of my In App Purchase section of the App Store Connect. Task { do { let storeProducts = try await Product.products(for: ["removeAds1", "cactusCoin5"]) DispatchQueue.main.async { self.products = storeProducts self.printProducts() } } catch { print("Failed to fetch products: \(error.localizedDescription)") } } Thank you for any assistance.
0
0
45
11h
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
77
2d
Transactions with the same webOrderLineItemId value but different transactionId
Hello I called the 'Get Transaction Info' API with Auto-Renewable Subscription product type transactionId. I received a success response and called the 'Get Transaction History' API with the value 'originalTransactionId'. The response 'transaction' of the 'Get Transaction History' API that matches the 'webOrderLineItemId' value received through the 'Get Transaction Info' API was found, but the 'transactionId' value was different. Why is this happening? Which of the two transactions is normal? https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history
0
0
65
3d
App store server notification on end of free trial period
Is there an App store server notification (V2) when the free trial period ends? Unfortunately, I can't find any information about whether and what information I receive as an app store notification when a free trail period expires. I assumed that there would be an expired or initial buy notification, but apparently this is not the case. Can anyone help me? Thank you!
2
0
51
3d
Testing presence of Purchased App in XCode
Plenty of info on test IAPs in xCode. I need to test whether the user has previously purchased the product in order to adjust my business model from a paid app to an in-app-purchased subscription. I have implemented the code from "What's New in StoreKit" found at https://developer.apple.com/wwdc22/10007?time=527 and this works. but I don't know how to create a mock purchase that I can use to validate a previous purchase. This means I have no way of testing if the code actually works with a previous purchase in place. My question is specifically: How do I create a mock/test "purchased product" that I can use in testing this functionality? For clarity, I have successfully test IAP IAW: https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode/ Thanks
2
0
120
4d
Storekit
I made in-app purchases using storekit and placed the ids in app store connect, but when I tried to test my application from Xcode, the purchase of the application was working, but when I tried it from the app store, it did not work.
0
0
64
5d
“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
150
6d
Subscription with Stripe
We want to have subscription that exist within user account. With Apple IAP if you buy a subscription once, it cannot be bought again for the same iCloud account. But if our user within our app logged out and created another account (app account not iCloud account) he should have ability to buy subscription for this new account. Does Apple allow to use third-party service to implement subscriptions now (e.g. Stripe)? Because Apple IAP renewable subscription model wont work for our case.
0
0
111
1w
App store server notifications
I am reaching out regarding an issue I have encountered with the notification data I received. Here are the relevant details: Notification Details: Notification Type: DID_CHANGE_RENEWAL_STATUS Subtype: AUTO_RENEW_DISABLED Concern: I noticed an inconsistency within the provided data: The data.signedrenewalinfo.autorenewstatus is indicated as "1," suggesting that auto-renewal is enabled. Contrarily, the subtype field asserts that AUTO_RENEW is disabled. I am puzzled by this contradiction. How is it possible that the autorenewstatus field indicates that auto-renew is enabled when the type specifically states the opposite? Any insights or guidance on resolving this discrepancy would be greatly appreciated. P.S base on following api -> https://developer.apple.com/documentation/appstoreservernotifications
0
0
124
1w
Different TransactionId But the same appAccountToken returned
Hello, Apple Developer Team, Recently, we have encountered some rather tricky issues regarding different transactionIds but the same appAccountToken appearing in the JSON data returned when calling the Apple API /inApps/v1/transactions/. The situation is as follows: We obtained the order numbers from the payment receipts provided by the customer. The customer gave us two different order numbers. The payment date is July 9, 2024. By checking our server, we can see two different transactionIds. However, when calling /inApps/v1/transactions/, the JSON data we receive contains the same appAccountToken. The purchase dates for these two orders are very close to each other: transactionId1: July 9, 2024, 21:37:06 transactionId2: July 9, 2024, 21:37:00 Additional Information: 1)The server is using App Store Server API V2. 2)The client is using StoreKit V1. 3)Environment: Production. 4)type: Consumable This issue is not an isolated case. It occurs almost every month. We kindly request assistance from the Apple Developer Team to help us identify and resolve this issue. Thank you.
1
1
96
1w
In-App-Payment required for Business Listing App?
Hello guys! I would appreciate your help. I am developing an app (next to my webapp). In this app users can register as either owners of moving company or as the customers. Moving company owners can list their company like a directory/business listing. The app is free to use for customers and also for company owners except if you want to list your moving company to be able to get clients and sell your physical service. Now i have a subscription plan in mind so the moving company can list itself, which will also be listen on my webapp as the databank is shared. According to someone this doesnt require IAP, because at the end the company is paying for the listing, to help him sell his physical service. next to it, i also want to get provision for each time the moving company gets a client through our app and pays through our app. thirdly, i was planning to offer sponsored Listing, which will aswell work for my webapp. Meaning if someone pays for sponsored listing on my app he gets sponsored on my webapp aswell and vice versa. And lastly, the subscription plan has an upgrade package where moving companies can get leads aswell. Like the first thing someone told me that it shouldnt require IAP as the end service us physical and thats where i am helping out. Now i wanted to be safe than sorry and wanted to know what you guys say. Is is allowed without IAP? Where do i need IAP and where can i for example use Stripe? Are there any ways to go around IAP? I have already read the guidelines but it seems my app functions fall between them (probably) as the sponsored Listings are also on webapp if bought in mobile app aswell as the physical services that are promoted and sold through our subscription, where we dont really offer a digital service. I would really appreciate your help very much, and i thank you for reading all this.
0
0
127
1w
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
5
4
274
1w
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
99
1w