Hi all, I’m trying to use the Google IAP v3 plugin… however, store.isActive always returns false.
I have set everything up correctly and read over and over the docs to make sure all is set up correctly…
First, I have build.settings set up correctly with the plugin, billing permission and license key as specified in http://docs.coronalabs.com/daily/plugin/google-iap-v3/index.html
Next, in the guide as in here: http://docs.coronalabs.com/daily/guide/monetization/IAP/index.html the following statement seems wrong: " Now you should build your app — even if it’s still in development — to create a .apk file which can be uploaded to the Google Play Developer Console. Once it’s uploaded, you must activate it, but do not publish it yet!" I believe Google docs say that you must upload a signed APK to either alpha or beta and publish it. I have done this - it’s up in alpha and fully published.
- My IAPs are all up on Google Play and made active, ready to use.
- My device and the build published in Alpha on Google play both use the same version code - so no discrepency there.
- IAPs and published APK have been live for days now so no propogation delay there…
- The Google account I’m using on my device (logged into Google Play app) is not my developer account. Also, this Google account is set up as a test account in Google Play Dev Console. Also, I have a Google Group set up with this account in it so that in Alpha/Beta testing this account has access…
- Older device (HTC First) with Android version like 4.1.1 so should be no problem there…
Next, here’s sample code up to the store.isActive call…
I have a “Store” lib (capital “S”) that contains all of my store code. _ It’s running perfectly on iOS. _ Within Google, I have errors…
Including the store lib correctly…
Store.initialize = function() if device.isApple or device.isGoogle then store.init( store.target, Store.callback ) native.showAlert("STORE INIT", tostring(store.isActive), {'OK'}) end end
On system applicationStart and applicationResume I’m calling an initialize function which runs this code…
if device.isApple or device.isGoogle then store.init( store.target, Store.callback ) native.showAlert("STORE INIT", tostring(store.isActive), {'OK'}) end
In that function when run, the native alert on the device returns false for store.isActive.
Next, when I try to actually load products, I do this…
native.showAlert("LOAD PRODUCTS", tostring(store.isActive) .. ' / ' .. tostring(store.canMakePurchases), {'OK'}) if store.isActive then if store.canLoadProducts then store.loadProducts( Store.UID, Store.process ) end end
In this case, the native alert returns “false / true”. The conditional below never runs because store.isActive is false. Store.UID is simply a table with IAP identifiers and Store.process is a callback to handle the return from loadProducts. Again, in iOS this is working just fine.
Rob or anyone else… any ideas or insight you can shed on this issue? Thanks!!
Nate