no logs to Flurry from inside storeListener with google-iap-v3 (and my solution)

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

I found the solution, its not (directly) related to the new google iap v3.

The problem is, that you can not do two logs to flurry to close together. I use now a delay of 900 ms that is working, 500 was to short.

My problem was, that I logged when the player taped onto the buy something button AND when the storelistener was called. Now that the playstore v3 stores the things partly on the device, to be faster, it IS faster, which got my old code to break, because then the two flurry logs were too close. (actually just the log did not work, rest continued working)

So, for anybody not seeing Flurry logs, it might be the case that you log two events too fast together…

I found the solution, its not (directly) related to the new google iap v3.

The problem is, that you can not do two logs to flurry to close together. I use now a delay of 900 ms that is working, 500 was to short.

My problem was, that I logged when the player taped onto the buy something button AND when the storelistener was called. Now that the playstore v3 stores the things partly on the device, to be faster, it IS faster, which got my old code to break, because then the two flurry logs were too close. (actually just the log did not work, rest continued working)

So, for anybody not seeing Flurry logs, it might be the case that you log two events too fast together…