libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
225 stars 82 forks source link

TrivialDrive #30

Closed vuongthanhtai closed 9 years ago

vuongthanhtai commented 9 years ago

I need a method for this: // Do we have the premium upgrade? Purchase premiumPurchase = inventory.getPurchase(SKU_PREMIUM); mIsPremium = (premiumPurchase != null && verifyDeveloperPayload(premiumPurchase)); Log.d(TAG, "User is " + (mIsPremium ? "PREMIUM" : "NOT PREMIUM"));

can u add more interface in PurchaseManager to check products purchased. I think you should make an example as TrivialDrive.

noblemaster commented 9 years ago

Currently gdx-pay doesn't contain an inventory class until someone implements it (sorry)! Right now, you need to keep track of purchased items yourself.

I suggest you implement a Inventory.java class where you keep track of all purchased items. Instead of using PurchaseSystem/Manager directly you would only use your Inventory.java class which every time you restore/purchase will automatically keep track of items purchased in a properties file. That way you could then check for purchased items via boolean hasPurchased(identifier) or something along that line. Inventory.java should duplicate the methods in PurchaseManager.

vuongthanhtai commented 9 years ago

:) Ok