Hi tamkinp,
I currently have a live version of the app on Amazon and the in-app purchase that I have created has been approved as well. My problem is that how should I call the in-app of Amazon. Below is my code for calling it, I am not sure if I did it correctly because upon testing it on the device, my phone just freezes.
local removeAds = widget.newButton
{
defaultFile = “images/removeAds2.png”,
overFile = “images/removeAdsOver2.png”,
id = “remove ads”,
onRelease = function(event)
if event.phase == “ended” then
if system.getInfo(“targetAppStore”) == “amazon” or system.getInfo(“environment”) == “simulator” then
store = require “plugin.amazon.iap”
store.init( storeListener )
print("The currently logged in user is: ", store.getUserId())
store.restore()
if store.canLoadProducts == true then
store.loadProducts({“my.product.removeads”}, loadProductsListener)
end
if store.isSandboxMode() == true then
store.purchase(“my.product.removeads”)
else
store.purchase(“my.product.removeads”)
end
end
end
end,
}
removeAds:setReferencePoint(display.TopRightReferencePoint)
removeAds.x = display.contentWidth
removeAds.y = -removeAds.height * 0.3