Hi Dean,
There are two ways of going about this.
The easiest is to call iap.loadProducts as soon as possible after init.init() during your app initialisation (probably during the application.start() event, or in your main.lua file). Then, later in your app, see what value you get back from iap.getLoadProductsCatalogue(). If you get an empty table (ie. {} rather than nil), you know you are still waiting for your product info.
If you need more than this, you can call iap.loadProducts with a custom listener function. This will get called every time IAP Badger hears back from the store. You can use this to interrogate the native Corona event code. or just set a flag to say the catalogue is ready.
Your code would look something like this:
local catalogueReady=nil local function myListener(event) --Set flag to indicate catalogue ready catalogueReady=true --Event contains the native Corona store event if you want to do any further processing end --Initiate product catalogue loading from App Store etc. iap.loadProducts(myListener)
Later in your code, you can just query catalogueReady to check if you have the information back (or not). Be aware that your listener will receive the standard Corona event data, so product identifiers will be in their raw form - how they are entered in Google Play, the App Store etc., rather than converted back to a standard IAP Badger identifier.
To be fair, most of the time the second method is overkill. Checking for an empty {} table is enough to see if you’ve heard back from the App Store yet. Product information usually comes back very quickly, within a few seconds of calling iap.loadProducts(), even over a mobile network.