* experimental MVP PurchaseManager using Apple StoreKit2 API#273
* experimental MVP PurchaseManager using Apple StoreKit2 API#273dkimitsa wants to merge 6 commits intolibgdx:masterfrom
Conversation
uses `io.github.dkimitsa.robovm:robopods-storekit-swift` bindings for Swift based StoreKit2 API. implementation should be considered as POC and might some things might be broken.At least gdx-pay sample app was working with this manager.
|
Thanks, really great! One thing I would like to have: fill in the Free trial info only if the async function That is also how it works for Android, if the free trial is already used, Google Play won't return the trial. For Apple, it should be verified manually with |
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Outdated
Show resolved
Hide resolved
…s suggested by keesvandieren
|
@keesvandieren hi, have added check for |
|
Hi, I have tried out the purchase manager. I see prices, can fetch products / Information instances. Some callbacks seem to be missing:
Thanks for your work anyways, If you plan to complete them I would be happy to test it again. |
|
hi @keesvandieren , sorry for replying late. have implemented missing callbacks. also StoreKit2 api wrapper was updated with missing StoreKitError |
|
Hi, i came to do a hand with testing. In my app, im having an issue with One-Time charge purchasing. The first time i can do successfuly but at the second time, i get an error, this is the print of the error im having: Is like the transaction is not consumed. Maybe i have doing something wrong in my client iOS purchase process for that transaction, but at the moment, iOS purchasing are working good in my app Updated: This is the log that verify what im saying: |
|
@sebaber where all these logs other than |
|
Sorry for the late. I try to test again but in my project i have to update lo a higher version of gradle (8.14.3) and i have an issue of compatibility when i was trying to generate maven files on Narwhal IDLE. Is it possible to update this repo to a higher version of gradle? This is the error: |
|
Although, i think that these logs are from the class PurchaseManageriOSApple2 from For some reason for me, is like the purchase still remains in a queue after purchase, so next purchase send twice and start to increment in every next purchase |
|
For me this is quite hard to test. We have (in our app) only one single purchase (subscription), not multiple purchases. Anyone else with an app with consumables or multiple products who can tests this? |
|
Hi, I remember that ios always returns all historic transactions, when restoring purchases. This is also the case with the old implementation. So, for subscriptions for examples, if a subscription transaction is expired, it is still returned on iOS. On Android (Google Play implementation) only active transactions will be returned. So having historic payment / transactions on iOS is normal behaviour. Should we implement in gdx-pay that only currently valid transactions are returned? I don't know if that can be done easily. |
|
Hi @dkimitsa, is this already ready to be merged? Is this related to https://dkimitsa.github.io/2025/08/29/swift-missing-objc-class-structures/, are changes requested there already available for gdx-pay? |
|
hi @keesvandieren
issues mentioned in post is related to case when binaries are compiled for ios12. Anyway there is no need to compile ios15 sources against ios12 target so we can ignore these. will speak with tom-ski about arranging a repose and processes to release bindings. |
|
@keesvandieren |
|
hi @keesvandieren It was split into Java bindings: and kotlin wrappers (with coroutine flavour): I've update this PR is proper dependency. Personally I don't use StoreKit2 but there are active users so we monitor things to see if there is going to be any issue. Meanwhile, as part of |
|
Thanks @dkimitsa. I will have a look it it in one - two weeks. Few questions:
|
it was built against 2.3.23 but dependency listed as "provided". it will not be propagated as transitive dependency.same time there is nothing specific to depend on and older versions expected to work.
StoreKitRvm (swift to objc wrapper, native framework) was compiled with "min ios version 15"
Most of api from Storekit2.swift was wrapped as it was in ios18.2. If something is missing we can add it any time.
Cocoa touch is always present and it's huge. But if this api is not used the will not be included into binary (tree shaker can make it even better) .
yes, mostly its for kotlin projects. it will provide experience similar to swift concurrency, without callbacks etc. |
|
Due to libgdx bug I had to find a fix for, testing this was delayed. Finally hav some time now My use case:
I will give it a try locally, make it release it on my first app after 2nd of January and find out if it works well. If you have any additional suggestions please let me know. |
There was a problem hiding this comment.
Pull request overview
This PR introduces an experimental implementation of PurchaseManager for iOS using Apple's StoreKit2 API, providing a modern alternative to the existing StoreKit1-based implementation. The implementation includes comprehensive support for product queries, purchases, transaction handling, and promotional purchases.
Key Changes:
- Added StoreKit2 bindings dependency (robopods-swift-storekit2:18.2.0.1)
- Implemented new PurchaseManageriOSApple2 class with full StoreKit2 integration
- Support for async/await patterns through custom AsyncSequenceProcessor infrastructure
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 24 comments.
| File | Description |
|---|---|
| build.gradle | Added StoreKit2 dependency for RoboVM bindings |
| gdx-pay-iosrobovm-apple/build.gradle | Added StoreKit2 dependency to the iOS module |
| gdx-pay-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java | New implementation of PurchaseManager using Apple's StoreKit2 API with support for product fetching, purchasing, restoration, and promotional transactions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Show resolved
Hide resolved
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Show resolved
Hide resolved
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Show resolved
Hide resolved
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Outdated
Show resolved
Hide resolved
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Show resolved
Hide resolved
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Show resolved
Hide resolved
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Show resolved
Hide resolved
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Show resolved
Hide resolved
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Show resolved
Hide resolved
...y-iosrobovm-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple2.java
Outdated
Show resolved
Hide resolved
…/apple/PurchaseManageriOSApple2.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/apple/PurchaseManageriOSApple2.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@keesvandieren just a questions, was you able to link with this storekit2 api and run application on ios12 device (using PurchaseManageriOSApple.java) ? |
|
I'm a bit confused as to why there's a custom |
|
@dkimitsa not yet tried out with iOS 12. Planned do testing 2nd of January 2026 I think we have to do something like this: if (iosMajorVersion() < 15) return PurchaseManageriOSApple() else return PurchaseManageriOSApple2() |
recently I've added bindings for StoreKit2 swift based API. and as quick test have implemented PurchaseManager using it.
I have not any experience using
gdx-paybefore, thus implementation might be not completely as expected or something might be broken. was able to run sample app with it.Hope will be usefeul for contributors of
gdx-payquick start.Besides noted above following to me mentioned:
PurchaseIntentstarting in iOS 16.4 orpaymentQueue(_:shouldAddStorePayment:for:otherwise).hope this helps, while it is not migrated to MobiVM please open an issue if found there https://github.com/dkimitsa/robovm-cocoatouch-swift.