Exemple #1
0
    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;

        // Set play store extensions.
        _playStoreExtensions =
            m_StoreExtensionProvider.GetExtension <Google.Play.Billing.IGooglePlayStoreExtensions>();
        CheckSubscriptionsAvailabilityBasedOnReceipt(controller);
        // Pass an obfuscated account id.
        _playStoreExtensions.SetObfuscatedAccountId(TrivialKartClientUtil.GetObfuscatedAccountId());
        // Set the deferred purchases callback.
        _playStoreExtensions.SetDeferredPurchaseListener(
            delegate(Product product)
        {
            ProcessDeferredPurchase(product.definition.id);
            // Do not grant the item here. Instead, record the purchase and remind
            // the user to complete the transaction in the Play Store.
        });
    }
Exemple #2
0
        public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
        {
            log.Info(nameof(OnInitialized));
            storeController    = controller;
            extensionsProvider = extensions;
            if (!PlayerIdStorage.TryGetServiceId(out string playerServiceId))
            {
                log.Fatal("Не удалось достать playerServiceId");
                return;
            }
            IGooglePlayStoreExtensions playStoreExtensions =
                extensionsProvider.GetExtension <IGooglePlayStoreExtensions>();

            string obfuscatedAccountId = playerServiceId.Caesar();

            playStoreExtensions.SetObfuscatedAccountId(obfuscatedAccountId);
        }