I have created a settings.lua “object” that handles user preferences, game settings and handles in-app purchases. If I try and use a method for my store callback, it fails to pass the event. if I use a regular function then it works just fine.
I have shortened most of the code, but essentially, I have this:
local settings = {} local transactionCallback function settings:init() 1. --\> store.init("google", transactionCallback) 2. --\> store.init("google", settings.storeCallback) end function settings:purchaseApp() store.purchase({android.test.purchased}) end function settings:storeCallback(event) ..callback code.. end function transactionCallback(event) ..callback code.. end return settings{}
If i make my purchase and use the “transactionCallback”, everything works fine. if I use the “settings.storeCallback” the event isn’t passed.
I am just curious as to why this won’t work, or if there is a solution other than just using the regular callback method.
Thanks