StoreKit

RSS for tag

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

StoreKit Documentation

Post

Replies

Boosts

Views

Activity

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
350
Jul ’24
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
321
Jul ’24
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
332
Jul ’24
Issues passing down promotional offer signature values
We have a React Native application and are implementing Promotional Offers for our subscriptions. Our backend service decides what users are eligible for the offer and will send the offer and signature in the request. The SKU, offer, and signature values are sent over the bridge to Objective-C where we then attach the discount to the payment if one exists. When we hardcode the signature values on objective-C we get a successful purchase. When we try to use the signature parameters that were passed down we get a purchase error (SKErrorDomain: 12) Some code snippets here: if (offerSignature[@"offerId"] != nil) { // convert timestamp to NSNumber NSString *numberString = offerSignature[@"timestamp"]; NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; NSNumber *number = [formatter numberFromString:numberString]; productIAP.paymentDiscount = [ [SKPaymentDiscount alloc] initWithIdentifier: offerSignature[@"offerId"] keyIdentifier: offerSignature[@"keyIdentifier"] nonce: [[NSUUID alloc] initWithUUIDString:offerSignature[@"nonce"]] signature: offerSignature[@"signature"] timestamp: number]; } Here we are adding the SKPaymentDiscount to our custom product. and later on add it to the SKMutablePayment in the following snippet SKMutablePayment *productIAPPayment = [SKMutablePayment paymentWithProduct:productIAP.skProduct]; productIAPPayment.applicationUsername = [self hashedValueForAccountName]; if (productIAP.paymentDiscount != nil) { productIAPPayment.paymentDiscount = productIAP.paymentDiscount; } When we hardcode the values using the same values our backend service sends the payment goes through. Here is a snippet of how it looks like when we hardcode the values productIAP.paymentDiscount = [ [SKPaymentDiscount alloc] initWithIdentifier: @"offer-here" keyIdentifier: @"keyIdentifier-here" nonce: [[NSUUID alloc] initWithUUIDString:@"nonce-here"] signature: @"signature-here" timestamp: @1715303421691]; We have attached the debugger and have verified the values are correct and at this moment do not know what else we can do to get this unblocked.
0
0
297
Jul ’24
购买订阅型商品 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
375
Jul ’24
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.
4
0
369
Jul ’24
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
316
Jul ’24
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
326
Jul ’24
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
490
Jul ’24
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
396
Jul ’24
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.
1
0
229
Jul ’24
“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.
12
7
1.1k
Jul ’24
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
310
Jul ’24
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
313
Jul ’24
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
2
294
Jul ’24
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
281
Jul ’24
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
26
13
3.0k
Jul ’24