I recentyl switched to the new google iap v3 plugin.
It works quite well until now, but needs more testing.
I do have a problem with my Flurry logs which I do when the storeListener is called.
Before the switch I could simply log like this:
local transaction = event.transaction local tempTable = {} tempTable.tstate = transaction.state if tempTables.transaction.state == "failed" then print("Transaction failed, type: " .. transaction.errorType .. " -- error string: " .. transaction.errorString) tempTable.errorType = transaction.errorType tempTable.errorString = transaction.errorString elseif transaction.state == "consumed" or transaction.state == "purchased" then tempTable.productID = transaction.productIdentifier tempTable.productID2 = transaction.identifier end tempTable.PlayerLevel = gameSettings.level analytics.logEvent("storeListener called", tempTable) tempTable = nil
Now I do not more get a log to Flurry if I use that code.
After hours of testing I found that the following piece of code works, but I need to use a global variable.
tempTables.transaction = event.transaction timer.performWithDelay(400, function() local tempTable = {} tempTable.tstate = tempTables.transaction.state if tempTables.transaction.state == "failed" then print("Transaction failed, type: " .. tempTables.transaction.errorType .. " -- error string: " .. tempTables.transaction.errorString) tempTable.errorType = tempTables.transaction.errorType tempTable.errorString = tempTables.transaction.errorString elseif tempTables.transaction.state == "consumed" or tempTables.transaction.state == "purchased" then tempTable.productID = tempTables.transaction.productIdentifier tempTable.productID2 = tempTables.transaction.identifier end tempTable.PlayerLevel = gameSettings.level analytics.logEvent("storeListener called", tempTable) tempTable = nil tempTables.transaction = nil end)
I dont know why it works just like this. I tested it with 100 ms delay and it did not work.
Just for the case, that somebody else runs into this problem, and maybe the corona stuff is interested in this problem too.
Cheers,
Felix