Hello everyone,
We are trying to load our in-app-item into our app but it doesn’t work.
We have been working with this issue around 3 days already and nothing seems to work :(.
We get these two errors
1. the item you were attempting to purchase could not be found.
2. invalidClient
Following are works that we have done
-
Package of the app and the one on server is exactly the same.
-
Keystore is exactly the same.
-
We use tester account, which is not a developer account to test our app.
-
We know that store.loadProducts() doesn’t work with IAP V2.
-
Test product ID works fine.
-
Item in developer console is active
-
the App is published (to beta tester)
-
We use Pro version of Corona.
Below is our code
local t = display.newText("Test Billing",0,0,native.systemFont,12); local store = require("store") display.setStatusBar( display.HiddenStatusBar ) io.output():setvbuf('no') local count = 0 local googleProductList = { "com.mad.testonly.item1", } function transactionCallback( event ) local infoString = ""; count = count+1 t.text = t.text .. "\n\n transactionCallback " .. count; if event.transaction.state == "purchased" then t.text = t.text .. "\nTransaction successful!" elseif event.transaction.state == "restored" then -- Reminder: your app must store this information somewhere -- Here we just display some of it infoString = "Restoring transaction:" .. "\n Original ID: " .. tostring(event.transaction.originalTransactionIdentifier) .. "\n Original date: " .. tostring(event.transaction.originalDate) t.text = t.text .. "\n" .. infoString elseif event.transaction.state == "refunded" then infoString = "\nFor product ID = " .. tostring(event.transaction.productIdentifier) descriptionArea.text = infoString t.text = t.text .. "\nA previously purchased product was refunded by the store." .. infoString elseif event.transaction.state == "cancelled" then t.text = t.text .. "\nTransaction cancelled by user." elseif event.transaction.state == "failed" then infoString = "Transaction failed, type: " .. tostring(event.transaction.errorType) .. " " .. tostring(event.transaction.errorString) t.text = t.text .. "\n" .. infoString else infoString = "Unknown event" t.text = t.text .. "\n" .. infoString end t:setReferencePoint(display.TopLeftReferencePoint); t.x,t.y = 0,0; store.finishTransaction( event.transaction ) end function loadProductsCallback( event ) t.text = t.text .. "\nAfter store.loadProducts, waiting for callback"; t.text = t.text .. "\n purchase :com.mad.testonly.item1"; store.purchase( {"com.mad.testonly.item1"} ); end function setupMyStore(event) if store.canLoadProducts then store.loadProducts( googleProductList, loadProductsCallback ) else t.text = t.text .. "\nCan't loadProducts"; t.text = t.text .. "\n purchase :com.mad.testonly.item1"; store.purchase( {"com.mad.testonly.item1"} ); end end if store.availableStores.google then store.init("google", transactionCallback) t.text = t.text .. "\nUsing Google's Android In-App Billing system."; t:setReferencePoint(display.TopLeftReferencePoint); t.x,t.y = 0,0; else t.text = t.text .. "\nIn-app purchases is not supported on this system device."; t:setReferencePoint(display.TopLeftReferencePoint); t.x,t.y = 0,0; end
Would really appreciate some help with this issue :wub:
Cheers!
Nate