hello i have follow the instruction to use amazon iap, i do some test in general android device, i do success to init the store with amazon SDK tester also it succed to login but i always get 0 products list from amazon even i have put the amazon.sdktester.json same as describe in this page https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/installing-and-configuring-app-tester heres some log – STORE TARGET = amazon logged in user is DefaultTestUser isSandboxMode true showing valid products 0 {“invalidProducts”:[],“products”:[]} and here is my code build.settings androidPermissions = { “com.android.vending.BILLING”, “android.permission.INTERNET”, “android.permission.READ_PHONE_STATE”, “android.permission.VIBRATE”, “com.android.vending.CHECK_LICENSE”, “android.permission.WRITE_EXTERNAL_STORAGE” }, main.lua function transactionCallback(event) print(“store transactionCallback”); native.setActivityIndicator(false); if event.transaction.state == “purchased” then --or event.transaction.state == “restored” then – elseif event.transaction.state == “restored” then – elseif event.transaction.state == “cancelled” then – elseif event.transaction.state == “failed” then local infoString = “Something went wrong. Please try and purchase your selected product again”; local alert = native.showAlert(“Purchase failed”, infoString,{“OK”}, onAlertFailedPurchase); else local infoString = “Something went wrong”; local alert = native.showAlert(“Unknown error”, infoString,{“OK”}, onAlertFailedPurchase); end store.finishTransaction(event.transaction); end function loadProductsCallback(event) print(“showing valid products”, #event.products, json.encode(event)) for j=1, #_G.listOfProducts do for i=1, #event.products do 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; end; print(j…" “…event.products[j].productIdentifier…”-"…_G.listOfProducts[j]); end; end store = require( “plugin.amazon.iap” ); store.init( transactionCallback ); print( “logged in user is”, store.getUserId(), “isSandboxMode”, store.isSandboxMode() ); store.loadProducts({ “iap_01”, “my_real_sku” }, loadProductsCallback); and my amazon.sdktester.json is { “iap_01”:{ “itemType”: “CONSUMABLE”, “price”: 0.99 , “title”: “my title”, “description”: “my description”, “smallIconUrl”: “”, } }
Hi there,
I don’t think the problem is that Amazon IAP doesn’t support load products. On this page, it says that Google and iOS support the function, but doesn’t mention Amazon.
Simon
Hi there,
I don’t think the problem is that Amazon IAP doesn’t support load products. On this page, it says that Google and iOS support the function, but doesn’t mention Amazon.
Simon