Does Store.Init Need a global callback function if different LUA files?

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. :slight_smile:

Thanks!
Thy [import]uid: 42145 topic_id: 15292 reply_id: 315292[/import]

I do believe that having it as a local will fail come test time, yes.

You could test it quite easily on the Xcode simulator - but if you are using multiple files you will really need to make sure the callback can be seen, which means not making it local outside of the appropriate file as you are currently doing. [import]uid: 52491 topic_id: 15292 reply_id: 56486[/import]

Thanks!

Thy [import]uid: 42145 topic_id: 15292 reply_id: 56521[/import]

This is my problem too. How can my I make the callback accessible in my other files? I tried removing “local” (to make it global) but my transactions still fails. Any ideas? [import]uid: 44127 topic_id: 15292 reply_id: 84708[/import]