Exemple #1
0
        //
        // --- IStoreListener
        //

        public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
        {
            // Purchasing has succeeded initializing. Collect our Purchasing references.
            Debug.Log("OnInitialized: PASS");

            // Overall Purchasing system, configured with products for this application.
            m_StoreController = controller;
            // Store specific subsystem, for accessing device-specific store features.
            m_StoreExtensionProvider = extensions;

            Debug.Log("Product: " + Purchaser.kProductNameAppleSubscription);
            Product product = m_StoreController.products.WithID(Purchaser.kProductNameAppleSubscription);

            Debug.Log("isoCurrencyCode: " + product.metadata.isoCurrencyCode);
            Debug.Log("localizedDescription: " + product.metadata.localizedDescription);
            Debug.Log("localizedPrice: " + product.metadata.localizedPrice);
            Debug.Log("localizedPriceString: " + product.metadata.localizedPriceString);
            Debug.Log("localizedTitle: " + product.metadata.localizedTitle);

            if (product.metadata.localizedTitle.Length > 0)
            {
                localizedTitle = product.metadata.localizedTitle;
            }
            if (product.metadata.localizedDescription.Length > 0)
            {
                localizedDescription = product.metadata.localizedDescription;
            }
            if (product.metadata.localizedPriceString != null)
            {
                priceReceived        = true;
                localizedPriceString = product.metadata.localizedPriceString;
            }

            AppCentralPaymentsHandler.ShowPaywall();
        }
Exemple #2
0
 public static void ShowPaywall()
 {
     if (AppCentralPaymentsHandler.IsUserSubscribed())
     {
         Debug.Log("User already subscribed, not showing paywall");
         return;
     }
     Debug.Log("Showing paywall");
     AppCentralPaymentsHandler.purchaser.windowOpen = true;
 }