![]() Note: You can use auto-initialize together with IAP Buttons or Listeners. ![]() In order to work, your catalog must contain at least one Product. This ensures that UnityPurchasing initializes immediately when the application starts, and eliminates dependencies on the codeless instances’ lifecycles. In these cases, check Automatically initialize UnityPurchasing (recommended) at the bottom of the IAP Catalog window. However, you may need to initialize the SDK before an IAP Button or IAP Listener appears in your game. This occurs automatically when the first instance of a Codeless IAP Button or IAP Listener loads at run time. The IAP SDK must initialize in order for in-app purchasing to work. Public void OnPurchaseFailed (Product i, PurchaseFailureReason p)Īutomatically initializing UnityPurchasing Return PurchaseProcessingResult.Complete Public PurchaseProcessingResult ProcessPurchase (PurchaseEventArgs e) / May be called at any time after OnInitialized(). Public void OnInitializeFailed (InitializationFailureReason error) / will attempt initialization until it becomes available. / Note that this will not be called if Internet is unavailable Unity IAP / Called when Unity IAP encounters an unrecoverable initialization error. Public void OnInitialized (IStoreController controller, IExtensionProvider extensions) / Called when Unity IAP is ready to make purchases. UnityPurchasing.Initialize (this, builder) Public class MyIAPManager : IStoreListener , You should design your store accordingly by preventing users from attempting to make purchases if initialization has not completed successfully. Initialization will only fail if Unity IAP encounters an unrecoverable problem such as a misconfiguration or IAP being disabled in device settings.Ĭonsequently Unity IAP may take an arbitrary period of time to initialize indefinitely if the user is in airplane mode. Note that initialization will not fail if the network is unavailable Unity IAP will continue attempting to initialize in the background. You must provide an implementation of the IStoreListener interface which Unity IAP uses to inform your application of purchase-related events.Ĭall the UnityPurchasing.Initialize method to start the initialization process, supplying your listener implementation and configuration.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |