Hi there,
I’ve this piece of code…
local store = require("plugin.google.iap.v3") local function foo(event) print(event.transaction.state) end store.init("google", foo) print("purchasing ".. productID) store.consumePurchase(productID)
… but doesn’t work. When debugging, this is the traceback:
I/Corona (28152): purchasing: myProductID D/IabHelper(28152): Starting async operation: refresh inventory D/dchan (28152): Inventory refresh successful. (response: 0:OK) D/IabHelper(28152): Querying owned items, item type: inapp D/IabHelper(28152): Package name: com.myCompany.myApp D/IabHelper(28152): Calling getPurchases with continuation token: null D/Finsky (17304): [9156] InAppBillingUtils.getPreferredAccount: com.myCompany.myApp: Account from first account - [xxxxxxxxxxxxxxxxxxxxxxxxxxx] D/Finsky (17304): [9156] InAppBillingUtils.getPreferredAccount: com.myCompany.myApp: Account from first account - [xxxxxxxxxxxxxxxxxxxxxxxxxxx] D/IabHelper(28152): Owned items response: 0 D/IabHelper(28152): Continuation token: null D/IabHelper(28152): Querying SKU details. D/IabHelper(28152): queryPrices: nothing to do because there are no SKUs. D/IabHelper(28152): Querying owned items, item type: subs D/IabHelper(28152): Package name: com.myCompany.myApp D/IabHelper(28152): Calling getPurchases with continuation token: null D/Finsky (17304): [9132] InAppBillingUtils.getPreferredAccount: com.myCompany.myApp: Account from first account - [xxxxxxxxxxxxxxxxxxxxxxxxxxx] D/Finsky (17304): [9132] InAppBillingUtils.getPreferredAccount: com.myCompany.myApp: Account from first account - [xxxxxxxxxxxxxxxxxxxxxxxxxxx] D/IabHelper(28152): Owned items response: 0 D/IabHelper(28152): Continuation token: null D/IabHelper(28152): Querying SKU details. D/IabHelper(28152): queryPrices: nothing to do because there are no SKUs. D/IabHelper(28152): Ending async operation: refresh inventory D/IabHelper(28152): Starting async operation: consume D/IabHelper(28152): Ending async operation: consume
I wondered it could be some problem when adding the products in the Google Play Developer Console, but tried to purchase them through an Android native app and this works, but not using Corona…
The app key in config.lua is correct, the product id’s are also correct, I added “com.android.vending.BILLING” in userPermissions in build.settings… Don’t know what else may I miss…
Any idea?