Hi Brent,
Thanks for pointing that out (English Vs American there, the war continues
)
I changed that and it had no effect, store.isActive still replies with false and store.init() still fails to call the transactionCallback
Hi Brent,
Thanks for pointing that out (English Vs American there, the war continues
)
I changed that and it had no effect, store.isActive still replies with false and store.init() still fails to call the transactionCallback
I don’t believe the transaction listener expected to trigger on store.init(), but rather just on other purchase-related events. Have you (in the past) seen different behavior on that point?
Brent
Hi again,
A couple of thoughts:
Hi Brent,
No, one of the problems I’m currently facing, with regards to this, is my low level of knowledge (This is the first time I’ve added In-App Purchases)
Its more that the .isActive() returns with false on both the Nexus 7 Tablet and My Motorola Android phone.
Hi Simon,
Yes, I have downloaded several (Turbo dismount for example)
store.purchase doesn’t work because store.loadProducts doesn’t activate its callback listener either (It fails to return any products at all…)
UPDATE: I decided that I would go back to the very beginning. I created a basic app through corona, copied in the monetisation sample code config.lua and build.settings files (with the appropriate key) and built it. It returns the same results…
Hi Matthew,
I’ve just noticed that you are an Enterprise user, and all of my experience is with the standard Corona setup.
I’m just wondering if there are any additional steps you have to go through on Enterprise to get Google IAP v3 running correctly?
Someone else may be able to advise you better with this, but could it be something to do with including all the correct JAR libraries or the entries in your AndroidManifest.xml file?
Hi Matthew,
Following up on happymongoose’s suggestions regarding Enterprise, there are a few additional steps to get Google IAP v3 working with Enterprise:
Ensure that plugin.google.iap.v3.jar is in your project’s libs folder.
Ensure the BILLING permission is added to your AndroidManifest.xml as such:
… <uses-sdk android:minSdkVersion=“10” android:targetSdkVersion=“21”/> <!-- Permissions required for Google IAP v3. --> <uses-permission android:name=“com.android.vending.BILLING” /> <uses-permission android:name=“android.permission.INTERNET”/> <uses-feature android:glEsVersion=“0x00020000”/> …
Assuming the issue isn’t with setup, can you provide the adb logcat output of your app starting at the point where you call store.init() and including immediately after store.isActive()?
As a side note, build.settings is ignored in Corona Enterprise for Android, so you’ll also need to transfer the androidPermissions lua table to AndroidManifest.xml as shown above.
Kinda late to this thread, but after scanning it… store.init() itself does not call the call back listener. The call back listener won’t fire until there is a purchase or restore request. Are we assuming you’re calling store.purchase()? In the top post, you say .init() doesn’t call it.
I just want to make sure we are not overlooking the obvious…
Rob
Hi All, thanks for your replies, I really appreciate your help 
I don’t use the enterprise version just SDK 
Ok, so now it seems to be working…
store.isActive returns true and I can request a list of products (They all display as invalid mind)
local store = require( "plugin.google.iap.v3" ) local function listener(event) local totalCounter = 1; local prodText = {} local invalidProd = {} native.showAlert("Products", #event.products, {"Ok"}); for i = 1, #event.products do prodText[i] = display.newText(event.products[i].title, 100, 100 + (50 \*i), native.systemFont); prodText[i]:setFillColor(255, 255, 255); end native.showAlert("Invalid Products", #event.invalidProducts, {"Ok"}); for i = 1, #event.invalidProducts do invalidProd[i] = display.newText(event.invalidProducts[i], 200, 100 + (50 \*i), native.systemFont); invalidProd[i]:setFillColor(255, 255, 255); end end local function callBack(event) native.showAlert("init Call Back", "Init call back", {"Ok"}) end local productList = {"productOne"} store.init(callBack) --native.showAlert("store.canLoadProducts", tostring(store.canLoadProducts), {"Ok"}) --native.showAlert("store.isActive", tostring(store.isActive), {"Ok"}) store.loadProducts( productList, listener )
I’m not really sure whats changed, if somebody could enlighten me, I would be incredibly grateful - I hate not knowing why something didn’t work and now does.
I just want to post this here for future reference (Incase I forget/somebody else has that same problem I did)
If you do what I did (Which was make a small test program to test your in-app purchases) you must make sure the package IDs are the same, when building (For android of course), as the ID you’ve uploaded to the store.
Further, the product ID Numbers should also match the build ID (i.e. com.companyname.product should match com.companyname.app - its the com.companyname that’s important)