public void buyProduct(string productId)
    {
                #if !UNITY_EDITOR
        if (!_IsStoreLoaded)
        {
            Debug.LogWarning("buyProduct shouldn't be called before store kit initialized");
            SendTransactionFailEvent(productId, "Store kit not yet initialized", IOSTransactionErrorCode.SKErrorPaymentNotAllowed);

            return;
        }
        else
        {
            if (!_IsInAppPurchasesEnabled)
            {
                SendTransactionFailEvent(productId, "In App Purchases Disabled", IOSTransactionErrorCode.SKErrorPaymentNotAllowed);
                return;
            }
        }

        IOSNativeMarketBridge.buyProduct(productId);
                #else
        if (IOSNativeSettings.Instance.SendFakeEventsInEditor)
        {
            FireProductBoughtEvent(productId, "", false);
        }
                #endif
    }
Example #2
0
    public void buyProduct(string productId)
    {
        if (!_IsStoreLoaded)
        {
            Debug.LogWarning("buyProduct shouldn't be called before store kit initialized");
            SendTransactionFailEvent(productId, "Store kit not yet initialized");

            return;
        }
        else
        {
            if (!_IsInAppPurchasesEnabled)
            {
                SendTransactionFailEvent(productId, "In App Purchases Disabled");
            }
        }

        IOSNativeMarketBridge.buyProduct(productId);
    }
Example #3
0
    public void BuyProduct(string productId)
    {
                #if !UNITY_EDITOR
        OnTransactionStarted(productId);

        if (!_IsStoreLoaded)
        {
            if (!IOSNativeSettings.Instance.DisablePluginLogs)
            {
                ISN_Logger.Log("buyProduct shouldn't be called before StoreKit is initialized");
            }
            SendTransactionFailEvent(productId, "StoreKit not yet initialized", IOSTransactionErrorCode.SKErrorPaymentNotAllowed);

            return;
        }

        IOSNativeMarketBridge.buyProduct(productId);
                #else
        if (IOSNativeSettings.Instance.SendFakeEventsInEditor)
        {
            FireProductBoughtEvent(productId, "", "", "", false);
        }
                #endif
    }