I’ve worked with IAPs on iTunes and Google Play before and recently, I wanted to try IAPs with Amazon. After reading the docs, I understood that it’s not necessary to pass the target store when calling store.init. However, when I submitted my app to Amazon, this is the error I received:
1.Install and launch the app.
2.Tap on “Get More Coins”.
3.Tap on any of the IAP, an error message stating “This application does not support in-app purchase on this device” appears.
Since this doesn’t have to do with the actual purchase and probably just with starting the store, here’s the code I’m using to detect the store and the code to initialize the store.
local mystore = require "store" if(mystore.target == "amazon") then store.init(transactionCallback) elseif(mystore.target == "google") then store.init("google", transactionCallback) else store.init("apple", transactionCallback) end
Am I doing something wrote? Should I not be using .target?
Thank you! I’m running into other problems now. Here’s the problem I’m running into now:
1.Install and launch the app.
2.Tap on " More Coins".
3.Tap on any of the IAP icons.
4.It displays a run time error message stating “Runtime Error : bad argument#1 purchase”.
loadProducts simply tells you about the available items. This is not a required call.
The error message states that you are not calling purchase() correctly. The Amazon IAP plugin only takes a single string, and not a table.
Try this, from the tutorial:
if system.getInfo("targetAppStore") == "amazon" then store.purchase( "com.acme.superrunner.upgrade" ) else store.purchase( { "com.acme.superrunner.upgrade" } ) end
Thank you! I’m running into other problems now. Here’s the problem I’m running into now:
1.Install and launch the app.
2.Tap on " More Coins".
3.Tap on any of the IAP icons.
4.It displays a run time error message stating “Runtime Error : bad argument#1 purchase”.
loadProducts simply tells you about the available items. This is not a required call.
The error message states that you are not calling purchase() correctly. The Amazon IAP plugin only takes a single string, and not a table.
Try this, from the tutorial:
if system.getInfo("targetAppStore") == "amazon" then store.purchase( "com.acme.superrunner.upgrade" ) else store.purchase( { "com.acme.superrunner.upgrade" } ) end