Skip to content

* experimental MVP PurchaseManager using Apple StoreKit2 API #273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dkimitsa
Copy link

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-pay before, 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-pay quick start.

Besides noted above following to me mentioned:

  • iOS version check to applied before using API: some are available ios15 but some requires ios17. in some cases it will require to use StoreKit1 api altogether with new one( like PurchaseIntent starting in iOS 16.4 or paymentQueue(_:shouldAddStorePayment:for: otherwise).
  • currently bindings are hosted at my account but primary repository will be under MobiVM umbrella.
  • not everything can be transparently migrated, things like purchase signature is a bit different now.

hope this helps, while it is not migrated to MobiVM please open an issue if found there https://github.com/dkimitsa/robovm-cocoatouch-swift.

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.
@keesvandieren
Copy link
Member

Thanks, really great!

One thing I would like to have: fill in the Free trial info only if the async function product.getSubscription().isEligibleForIntroOffer() returns true.

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 isEligibleForIntroOffer which now we can do with storekit2. However the conversion from Product to Information is currently being done in a synchronous method.

@dkimitsa
Copy link
Author

@keesvandieren hi, have added check for isEligibleForIntroOffer(). sadly has no setup to check if it works as expected.

d66cd94

@dkimitsa dkimitsa requested a review from keesvandieren April 25, 2025 12:11
@keesvandieren
Copy link
Member

Hi, I have tried out the purchase manager. I see prices, can fetch products / Information instances. Some callbacks seem to be missing:

  • com.badlogic.gdx.pay.ios.apple.PurchaseManageriOSApple2#purchase: on success, it should call observer.handlePurchaseError() on error, observer.handlePurchase() on success, observer.handlePurchaseCanceled() on cancellation
  • On restore cancellation (by ignoring the popup) handleRestoreError() is called by other implementations, I think PurchaseManageriOSApple2 should do too.

Thanks for your work anyways, If you plan to complete them I would be happy to test it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants