I unfortunately don’t own a Kindle and am trying to avoid breaking down and buying one… so for now I’m hopeful that someone out there might spot some issue with my code and may be able to help fix it. I have a feeling it’s something dumb…
Here’s my code:
store = require( "store" ) if store.target == "amazon" then store = require "plugin.amazon.iap" store.init( \_transactionCallback ) store.loadProducts({"com.lhg.games.noahsarkhd.unlockminigamesmin","com.lhg.games.noahsarkhd.unlockminigameswood","com.lhg.games.noahsarkhd.unlockminigamessilver","com.lhg.games.noahsarkhd.unlockminigamesgold","com.lhg.games.noahsarkhd.unlockminigamesdiamond"}, \_loadProductsListener) else if store.target == "apple" then -- and not \_settings:get("miniGamesPaid") timer.performWithDelay(1000, function() store.init( "apple", \_transactionCallback); end) end if store.target == "google" then -- and not \_settings:get("miniGamesPaid") timer.performWithDelay( 1000, function() store.init( "google", \_transactionCallback ); end ) end end --- then purchase function iapObj:purchase( productId ) if (debugOn) then print( "\_IAP - purchase( " .. productId .. " )" ) end store.purchase( { productId } ) end iapObj:purchase( "com.lhg.games.noahsarkhd.unlockminigamesmin" )
When testing IAP on Google Play, the change I made was to make the variable passed a table, instead of just the product id:
so:
-- was store.purchase( productId ) -- Didn't work on Google Play -- changed to store.purchase( { productId } ) -- worked
Not sure if that’s the problem… but I have confirmed that the failure does occur on this call… so not sure if there’s different syntax for Amazon vs Google Play…
Thanks in advance!
Scott D Brooks