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 Purchase works in TestFlight but not after Distribution
Good Day, This is my first app with In-App Purchase (IAP) for three simple consumable products. Ad For 1 Month, 2 Months and 3 Months. It works fine in Xcode and in TestFlight. App was approved and was automatically placed in App Store for distribution on July 25 morning. App publishes user's first ad free, by-passing StoreKit. but 2nd Ad onwards goes thru IAP. App works fine except screen with 3 consumable products/prices is not being displayed. Means IAP is not available in the distributed App whereas it all works fine in TestFlight. I googled, checked documents, asked chatGPT and submitted a question to Support (waiting for response). I don't know what I am missing. I read that it takes a day or two for IAP to work in App Store. Will appreciate any help. Thanks.
0
0
19
1h
APP Store Server Notifications Unrelated transactions info for auto-renewable subscription
Greetings for App Store Server Notifications especially sandbox (I have not tried production) it seems that that is no way to associate two transactions to their orignal subscription instance the docs indicate webLineItemOrderId id but they are different from each subscription the originalTransactionId is the same among all subscription instances and customers, theres originalPurchaseDate but that is not reliable becuase 2 transactions can occur on the same date what can be done here. I even tried to use it but its like the sandbox is broken with the originalPurchaseDate of one instance being the same as another. is it a bug or will things get in line once I go to production?
1
0
34
2d
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
86
2d
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
59
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
73
3d
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
88
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
107
4d
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.
1
0
108
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
113
1w
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
99
1w
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
79
1w
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
157
1w
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
83
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
216
1w
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
138
2w
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
147
2w