Post not yet marked as solved
My app downloads content from the Apple server using downloads:[SKdownload] found in SkPaymentTransaction. I want to upgrade my app to use StoreKit 2, but I can't find any download information in the StoreKit 2's Transaction or Product structs. Where do I find the downloads?
Post not yet marked as solved
I am using Storekit 2 for in-App Purchase, I am having problem regarding with manage subscriptions UI, when I click on manage subscriptions custom button then Manage subscriptions apple UI open and when I click on cross button , it does not remove on iPhone 13 and on the other hand on other iPhone XR the Subscription window is hide but app got stuck with black window
Post not yet marked as solved
Does anyone know what the StoreKit2 equivalent to original StoreKit's SKPaymentQueue.presentCodeRedemptionSheet() is?
I'm not seeing anything in the docs that appears to handle Offer Codes specifically. Yes, there's
static func promotionalOffer(offerID: String, keyID: String, nonce: UUID, signature: Data, timestamp: Int) -> Product.PurchaseOption
but promotional offers are a separate thing to Offer codes, I believe.
Appreciate any pointers anyone has on how to allow in-app redemption of an Offer Code using StoreKit2.
I'm assuming I should not include original StoreKit as well as StoreKit2 and call the older API, right?
Post not yet marked as solved
I'm trying to launch a new Mac-only app using SwiftUI and targeting macOS 12, so using the new StoreKit 2 APIs makes a ton of sense. My code for the purchases is largely based on the sample code from WWDC21, and it works really really well during local testing and when installed through TestFlight.
But the purchases never load when App Review runs the app. They've sent several screenshots, and none of the purchases are loaded and I haven no idea why.
I've made sure to select "In-App Purchase" in the "Signing & Capabilities" tab. I have created all of the purchases in App Store Connect, quadruple checked the identifiers match what the app is expecting, and made sure the purchases were submitted for review along with the app.
What else could I possibly be missing? Has anyone else had similar issues?
Post not yet marked as solved
In the latest Product object we are unable to get the price locale of the current product. Even though the display price string available with currency symbol, we need to display discount price of current product by comparing with other products.
Earlier in SKProduct we had price locale property to achieve this.But in latest Product object we are missing this.
Is there a way to get the price locale of the current storefront?. There is a countryCode property in Storefront enum. But there is no option to create locale using country code.
How can I validate an in-app purchase JWS Representation from StoreKit2 on my backend in Node?
Its easy enough to decode the payload, but I can't find public keys that Apple uses to sign these JWS/JWTs anywhere. Any other time I've worked with JWTs, you simply used the node jsonwebtoken library and passed in the signers public key or shared secret key, either configured or fetched from a JWK.
I do see the docs about validating the certificate chain in the x5c field but am at a bit of a loss on how to verify that its from Apple. Anyone can create a JWT and sign one.
Thank you!
Post not yet marked as solved
Using the Implementing a Store In Your App Using the StoreKit API sample code, I've successfully integrated my new APP with StoreKit 2. There is one problem though: when I call the method Transaction.latest(for:) to get the user’s latest transaction, it always returns nil.
Here's the code snippet:
guard let result = await Transaction.latest(for: myProductId) else {
return false
}
Is this a bug with StoreKit 2, or am I doing something wrong? This happens on a physical device, running from Xcode. Thanks in advance.
Post not yet marked as solved
I am building a app which only support iOS version over 15.0 and using storekit2 to make in app purchase. I read that by using storekit2 developer no longer need to restore purchase info manually. I wonder if I could dismiss a restore button in my app
I used StoreKit 2 to implement in-app purchases (maybe it was a wrong choice). It performed perfectly during the development and testing phases, but when I submitted the App for review, the products could not be loaded.
I checked the configuration and code many times, and used TestFlight to test on multiple devices, but the problem was not reproduced.
It is now suspected to be a problem with the StoreKit 2 and App Review environment.
I submitted a feedback using Feedback Assistant: FB9809466.
Now, I don’t know what I should continue to do to help myself solve the current dilemma.
Maybe I should use the old version of StoreKit to refactor everything?
Post not yet marked as solved
When we request the current entitlements for a user using the Transaction.currentEntitlements static method, does StoreKit provide transactions for subscriptions with a Product.SubscriptionInfo.RenewalState set to .inGracePeriod or only .subscribed?
I'm asking because as a developer we need to give access to content to a user if its subscription is in .inGracePeriod. So in my opinion, the user is still entitled to this subscription.
I've not found any information in the documentation, WWDC videos or Apple sample codes. The documentation explains
The latest transaction for each active auto-renewable subscription
Is .inGracePeriod considered an active subscription?
Let's imagine an app with two plans, one for individual (level of service 2) and one for family (level of service 1).
If a user is subscribed as an individual, but if someone in his family shares a family plan with him, will Transaction.currentEntitlements show both subscriptions?
Or only the transaction where the user is the owner (in this case the individual subscription)?
Post not yet marked as solved
I'm not a member of any Family in iCloud. I want to understand what happens when a user is subscribed through Family Sharing but also how to use StoreKit when the user is subscribed twice: as an individual who purchased the product and as a member of a family when the purchase is shared with him.
How can I test Family Sharing for an app offering a product with Family Sharing enabled? Is it possible to create a fake Family in App Store Connect and add testers to it?
Post not yet marked as solved
The response body for the body for the app store server notification responseBodyV2 on sandbox returns same originalTransactionId for different subscription product ids when decoded
Post not yet marked as solved
Hello,The Storekit 2 is pretty good, i want to Use it in my app right now,but i found some question?
1、unfinished transation never Automatic trigger on any where,such as when I start up again, how can i fetch the unfinished transations on some way?
2、i call transaction.finish(),but, when i user Transaction.unfinished to fetch all unfinished transations, the transaction i just finished, alway be funded
3、how can i verified jws myself, not call the autoVafified api you provide,can you has some demo?
Post not yet marked as solved
Hey folks!
One of my customers has problem when purchasing the in-app subscription:
The operation couldn't be completed (StoreKit.VerificationResult<StoreKit.Transaction>.VerificationError error 2.)
Any idea why this happens? I'm using the standard purchase verification
private func checkVerified<T>(_ result: VerificationResult<T>) throws -> T {
//Check if the transaction passes StoreKit verification.
switch result {
case let .unverified(_, error):
//StoreKit has parsed the JWS but failed verification. Don't deliver content to the user.
throw error
case .verified(let safe):
//If the transaction is verified, unwrap and return it.
return safe
}
}
Post not yet marked as solved
Hello,
When a user cancels a subscription during a free trial, we should stop providing access to content. How can we know that? From the in app management in Xcode, when I cancel a subscription during free trial period (cancelling in the few seconds after the purchase), the currentEntitlements still provide the subscription.
How to know when a user cancelled the subscription during free trial?
Thanks
In the session on StoreKit 2 (which looks amazing!), the presenter says:
In fact, if your app is running when a purchase is made on another device, you'll be notified about the new transaction.
This seems to mean that when an app uses the listener API to be notified of transactions, it will get transactions that happened on other devices.
My app offers purchases across other platforms in addition to iOS, and when a purchase happens we register it with our own account system. If a user has the app running on both their iPad and iPhone and makes a purchase on the phone, if the iPad gets notified of it the same way it would of a purchase made on the iPad, both devices will try to report it to our system. This seems undesirable.
What's the recommended approach here? Should we just make sure our system will disregard duplicate transaction reports? Or is there a way to know whether a transaction originated on this device? I don't see a property on the transaction type that looks like it could accomplish this. Maybe the deviceVerification properties? But that's seems more like the new edition of transaction receipt verification - failing that check would presumably mean that the purchase is invalid, not that it didn't happen on this device...?
Post not yet marked as solved
On an app that was using the old API for In-App Purchases (StoreKit 1). The app is already published on the App Store. The purchase is non-consumable.
While trying to migrate to StoreKit 2, I'm unable to restore purchases.
Specifically displaying and purchasing products works as expected, but when deleting and reinstalling the app, and then trying to restore purchases I can't do it.
I'm trying to restore them using the new APIs but it doesn't seem to be working.
What I have tried so far:
I'm listening for transaction updates during the whole lifetime of the app, with:
Task.detached {
for await result in Transaction.updates {
if case let .verified(safe) = result {
}
}
}
I have a button that calls this method, but other than prompting to log in again with the Apple ID it doesn't seem to have any effect at all:
try? await AppStore.sync()
This doesn't return any item
for await result in Transaction.currentEntitlements {
if case let .verified(transaction) = result {
}
}
This doesn't return any item
for await result in Transaction.all {
if case let .verified(transaction) = result {
}
}
As mentioned before I'm trying this after purchasing the item and deleting the app. So I'm sure it should be able to restore the purchase.
Am trying this both with a Configuration.storekit file on the simulator, and without it on a real device, in the Sandbox Environment.
Has anyone being able to restore purchases using StoreKit 2?
PD: I already filed a feedback report on Feedback Assistant, but so far the only thing that they have replied is:
Because StoreKit Testing in Xcode is a local environment, and the data is tied to the app, when you delete the app you're also deleting all the transaction data for that app in the Xcode environment. The code snippets provided are correct usage of the API.
So yes, using a Configuration.storekit file won't work on restoring purchases, but if I can't restore them on the Sandbox Environment I'm afraid that this won't work once released, leaving my users totally unable to restore what they have already purchased.
Post not yet marked as solved
our app integrates Apple Pay, and after the user pays successfully, our server obtains the original_transaction_id.
after we get the original_transaction_id, we call.
The https://api.storekit.itunes.apple.com/inapps/v1/history/ interface.
3.Url of request: https://api.storekit.itunes.apple.com/inapps/v1/history/30000931965136
4.The response result is:
{"revision":"0","bundleId":"live.vshow.live.dfgsdb2","appAppleId":1552575331,"environment":"Production","hasMore":false,"signedTransactions":[]}
5.Why is the result of signedTransactions empty?
Post not yet marked as solved
Hello, I have a markdown editor app, the model is in-app purchases, User download it for free,
and it have a 14-days trails for free (0 tier).
a PRO 5$ unlock all the features.
And it is not a subscribe model app.
In 14-days trails, user could use all the features too, after the 14-days trails, if user do not buy the PRO, it return to the view mode.
Example, user buy the 14-days trails in Oct 12, in Oct 15, user could use all features, how to get the purchase date, and validate the current date , if less than 14, user could still use all feature, and after 14 days, It return to view mode.
I find some document that build a server connect to App Store server may validate the receipt, but I see the StoreKit 2 documents says it could validate in local, my small project maybe use local validate is more simple.
How to check the user’s device date in or out of trails?
Thanks for any advice.