[Solved] Codeless IAP and store initialization

Hi, I would like to access the state of UnityPurchasing so that I can keep the store hidden if it’s not initialized. How do I go about it in codeless IAP?

@Grafos ,

Although it may claim otherwise, Codeless IAP isn’t actually codeless. You can see the core of the code in
/Plugins/UnityPurchasing/script/CodelessIAPStoreListener.cs

The CodelessIAPStoreListener class has a static Instance property you can use to see if Purchasing has been initialized. There are actually two bool to choose from:

  • unityPurchasingInitialized - Set to true when the Initialization is started.
  • initializationComplete - Set to true when Initialization is completed.

It’s also worth noting that Codeless IAP can be auto-initialized at start up, if you prefer. You can change this setting in the Product Catalog (under Window → Unity IAP → IAP Catalog).

3 Likes

Awesome, initializationComplete is exactly what I was looking for, thank you!