Hi,
I do not understand why my function “storeTransaction” is neved called by store.init
Yet “store.isActive” returns true
Thank you
my build.settings
-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", } }, plugins = { ["plugin.google.iap.v3"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, }, -- Android permissions androidPermissions = { "android.permission.INTERNET", "com.android.vending.BILLING", "com.android.vending.CHECK\_LICENSE", }, }
application = { content = { width = 320, height = 480, scale = "letterBox", fps = 30, --[[imageSuffix = { ["@2x"] = 2, } --]] }, license = { google = { key = "MIIxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxDAQAB", }, }, --[[-- Push notifications notification = { iphone = { types = { "badge", "sound", "alert", "newsstand" } } } --]] }
local store = require( "plugin.google.iap.v3" ) local storeTransaction store.init( "google", storeTransaction ) print(tostring(store.isActive)) local function storeTransaction( event ) local transaction = event.transaction print ("transaction.state="..tostring(transaction.state)) if ( transaction.state == "purchased" ) then --handle a successful transaction here print( "productIdentifier", transaction.productIdentifier ) print( "receipt", transaction.receipt ) print( "signature:", transaction.signature ) print( "transactionIdentifier", transaction.identifier ) print( "date", transaction.date ) elseif ( transaction.state == "cancelled" ) then print ("transaction cancelled") --handle a cancelled transaction here elseif ( transaction.state == "failed" ) then print ("transaction failed") --handle a failed transaction here end --tell the store that the transaction is complete! --if you're providing downloadable content, do not call this until the download has completed store.finishTransaction( event.transaction ) end