iAP not working on Android

Hey Guys,
 
Looking at some guidance at the moment on why my iAP are not working on Android. They are working on iOS fine but when I purchase them on Android using a “Test” account created purposely for this I get the following message " the item you are attempting to purchase could not be found"

works fine when I use the  android.test.purchased
 
I have done the following.
 

  1. Published my app in “Beta”
  2. ensured the SKU / Product ID match from in-game code to on the Android Developer console.
  3. ensured all my apps are “Enabled”
     
    DEVELOPER CONSOLE 

NAME/ID PRICE TYPE LAST UPDATE STATUS
1000 Beetle Juice (beetlejuice1000)  AUD 0.99 Managed product 17 Jul 2014 Active
1000 Juice (com.roedangames.beetlejuice.1000juice) AUD 0.99 Managed product 22 Jun 2014 Active
2000 Juice (com.roedangames.beetlejuice.2000juice) AUD 1.99 Managed product 22 Jun 2014 Active 
3000 Juice (com.roedangames.beetlejuice.3000juice) AUD 2.99 Managed product 22 Jun 2014 Active
 
CODE

local currentProductList = nil local appleProductList = { "com.roedangames.BeetleJuice.1000Juice", "com.roedangames.BeetleJuice.2000Juice", "com.roedangames.BeetleJuice.3000Juice" } local googleProductList = { --these product IDs are for testing and are supported by all Android apps (purchasing these products will not bill your account) "com.roedangames.beetlejuice.1000juice", "com.roedangames.beetlejuice.2000juice", "com.roedangames.beetlejuice.3000juice" } local iApResult local function iApListener(event) local transaction = event.transaction; print( "[STORE]: Transaction State is: " .. event.transaction.state ) print( "[STORE]: Pre-Purchase for: " .. event.transaction.productIdentifier) if ( transaction.state == "purchased" ) then print( "[STORE]: Purchasing: " .. event.transaction.productIdentifier ) --1000, 2000, 3000 Juice Purchased if event.transaction.productIdentifier == "beetlejuice1000" or event.transaction.productIdentifier == "com.roedangames.BeetleJuice.1000Juice" or event.transaction.productIdentifier == "android.test.purchased" then print( "You have just purchased 1000 juice" ) native.showAlert("Congratulations", "You have purchased 1000 Beetle Juice for in-game power-ups", {"Ok"}); juice = juice + 1000 elseif event.transaction.productIdentifier == "com.roedangames.beetlejuice.2000juice" or event.transaction.productIdentifier == "com.roedangames.BeetleJuice.2000Juice" then print( "You have just purchased 2000 juice" ) native.showAlert("Congratulations", "You have purchased 2000 Beetle Juice for in-game power-ups", {"Ok"}); juice = juice + 2000 elseif event.transaction.productIdentifier == "com.roedangames.beetlejuice.3000juice" or event.transaction.productIdentifier == "com.roedangames.BeetleJuice.000Juice" then print( "You have just purchased 3000 juice" ) native.showAlert("Congratulations", "You have purchased 3000 Beetle Juice for in-game power-ups", {"Ok"}); juice = juice + 3000 end settings:store( "juice", juice ) settings:save() elseif ( transaction.state == "cancelled" ) then native.setActivityIndicator(false); native.showAlert("Error", "The purchase was cancelled", {"Ok"}); elseif ( transaction.state == "failed" ) then native.setActivityIndicator(false); native.showAlert("Error", "The purchase has failed", {"Ok"}); end store.finishTransaction( event.transaction ) end if ( store.availableStores.apple ) then print( "[STORE]: using Apple Store" ) currentProductList = appleProductList store.init( "apple", iApListener ) elseif ( store.availableStores.google ) then print( "[STORE]: using Android Store" ) currentProductList = googleProductList store.init( "google", iApListener ) else print( "[STORE]: In-app purchases are not supported on this system/device." ) end local function productCallback( event ) --print( "In productIdentifier callback" ) print("showing valid products, There are: " .. #event.products .. " valid products") for i=1, #event.products do print(event.products[i].title) -- This is a string. print(event.products[i].description) -- This is a string. print(event.products[i].price) -- This is a number. print(event.products[i].localizedPrice) -- This is a string. print(event.products[i].productIdentifier) -- This is a string. end print("showing invalidProducts, There are: " .. #event.invalidProducts .. " invalid products") for i=1, #event.invalidProducts do print(event.invalidProducts[i]) end products = event.products end print( "[STORE]: Showing Products:" ) store.loadProducts( currentProductList, productCallback )

--ADD STORE BUTTONS FOR JUICE local function onjuice1000buttonRelease () if store.availableStores.apple then store.purchase( {"com.roedangames.BeetleJuice.1000Juice"} ) else print( "[STORE] Purchasing with Android" ) store.purchase( {"beetlejuice1000"} ) end end

please note I have also tested the above with “com.roedangames.beetlejuice.1000juice”

If you using Google IAP V3 plugin the store.purchase() parameter should be a string (table for iOS). Not sure if that applies if you are not using that plugin.

http://docs.coronalabs.com/daily/plugin/google-iap-v3/purchase.html

I would use iAP V3 but it appears I cannot. 

Type Library Revision 2014.2370 Keywords store Sample code /CoronaSDK/SampleCode/Store/InAppPurchase See also   Availability Basic, Pro, Enterprise

I have BASIC but V3 only appears to work on revision 2014.2370 which you cannot download unless you have access to I believe daily builds which requires Pro or above.

Hi @Savarok,

This plugin should be available to you at the Basic tier. That “Revision” line can be a bit misleading, and I may just remove it from all docs at some point.

http://docs.coronalabs.com/plugin/google-iap-v3/

Take care,

Brent

For some reason when I add it and set it up in my .build and .config files my projects just show up blank screen when built for devices using Corona (Version 2014.2189 (2014.3.6))

Thanks

Dan

Hi Dan,

Can you provide a console debugging report to see if you’re getting a specific error? Also, can you post the contents of your build.settings file here?

Thanks,

Brent

If you using Google IAP V3 plugin the store.purchase() parameter should be a string (table for iOS). Not sure if that applies if you are not using that plugin.

http://docs.coronalabs.com/daily/plugin/google-iap-v3/purchase.html

I would use iAP V3 but it appears I cannot. 

Type Library Revision 2014.2370 Keywords store Sample code /CoronaSDK/SampleCode/Store/InAppPurchase See also   Availability Basic, Pro, Enterprise

I have BASIC but V3 only appears to work on revision 2014.2370 which you cannot download unless you have access to I believe daily builds which requires Pro or above.

Hi @Savarok,

This plugin should be available to you at the Basic tier. That “Revision” line can be a bit misleading, and I may just remove it from all docs at some point.

http://docs.coronalabs.com/plugin/google-iap-v3/

Take care,

Brent

For some reason when I add it and set it up in my .build and .config files my projects just show up blank screen when built for devices using Corona (Version 2014.2189 (2014.3.6))

Thanks

Dan

Hi Dan,

Can you provide a console debugging report to see if you’re getting a specific error? Also, can you post the contents of your build.settings file here?

Thanks,

Brent