I am using Director, so have multiple screens. Short version: If I want to do a store.purchase() on a screen that is a different lua file than the file I call store.init(), does the the callback function need to be a global function?
Long version:
Using director, and have a loading screen and an IAP screen. In the loading screen, I have store.init(transactionCallBack)
.
transactionCallBack is a local function: local function transactionCallBack(event)
, and handles the different transaction types appropriately.
store is a global module: store = require("store")
However, when I transition to my IAP screen, the local function is gone. When I call store.purchase(), will it fail because while the store is global, the callback function called by store.init was local to a previous file?
As this is my first IAP program, wanted to just see what people thought before I tried to troubleshoot it.
Thanks!
Thy [import]uid: 42145 topic_id: 15292 reply_id: 315292[/import]