예제 #1
0
    private void Start()
    {
        // Map skus for different stores
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "sku");
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_AMAZON, "sku");
        OpenIAB.mapSku(SKU, OpenIAB_iOS.STORE, "sku");
        //    OpenIAB.mapSku( SKU, OpenIAB_WP8.STORE, "sku" );

        OpenIAB.mapSku(SKU_Pack1, OpenIAB_iOS.STORE, "pack1");
        OpenIAB.mapSku(SKU_Pack2, OpenIAB_iOS.STORE, "pack2");
        OpenIAB.mapSku(SKU_Pack3, OpenIAB_iOS.STORE, "pack3");
        OpenIAB.mapSku(SKU_Pack4, OpenIAB_iOS.STORE, "pack4");
        OpenIAB.mapSku(SKU_Pack5, OpenIAB_iOS.STORE, "pack5");

        var publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmf0kVFCutMdWCEpDOTJG9YxLpjmyckyThaKUDRhAFtXcO1dURsMynAnE+yRJxs1491cJBtXR2C2R956zl4ZC44IvNHCm3o8+UAEh5DhneEmObMlm7kX/h8GNJpCdxKRX5SGSux6CpnsdpqTa6SpC9sr0C25rNitkXdz1cPNBxZiDoti0Nvdw93nko0YbL3S8NeVLSG7te964Sa19dF8G30t1+YYLlSIvIZ+RylwTAaApxC63BvHV6vHZydGk7ljmXSNjGrHQmLWT8g3eJQSgf9lkdj1+qXZM1W8gN4fnT2pFzf979g+qQGPX2cDPVzT+cT+8zC6cGtoKqw7+LILPcQIDAQAB";

        var options = new Options();

        options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
        options.discoveryTimeoutMs      = Options.DISCOVER_TIMEOUT_MS * 2;
        options.checkInventory          = false;
        options.verifyMode          = OptionsVerifyMode.VERIFY_SKIP;
        options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE, OpenIAB_Android.STORE_AMAZON, OpenIAB_Android.STORE_YANDEX };
        options.storeKeys           = new Dictionary <string, string> {
            { OpenIAB_Android.STORE_GOOGLE, publicKey }
        };
        options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;
        // Transmit options and start the service
        OpenIAB.init(options);
    }
예제 #2
0
    private void Start()
    {
        // Map skus for different stores
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "sku");
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_AMAZON, "sku");
        OpenIAB.mapSku(SKU, OpenIAB_iOS.STORE, "sku");
        //    OpenIAB.mapSku( SKU, OpenIAB_WP8.STORE, "sku" );

        OpenIAB.mapSku(SKU_Pack1, OpenIAB_iOS.STORE, "pack1");
        OpenIAB.mapSku(SKU_Pack2, OpenIAB_iOS.STORE, "pack2");
        OpenIAB.mapSku(SKU_Pack3, OpenIAB_iOS.STORE, "pack3");
        OpenIAB.mapSku(SKU_Pack4, OpenIAB_iOS.STORE, "pack4");

        var publicKey = "------ Google Play public KEY here ----- ";

        var options = new Options();

        options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
        options.discoveryTimeoutMs      = Options.DISCOVER_TIMEOUT_MS * 2;
        options.checkInventory          = false;
        options.verifyMode          = OptionsVerifyMode.VERIFY_SKIP;
        options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE, OpenIAB_Android.STORE_AMAZON, OpenIAB_Android.STORE_YANDEX };
        options.storeKeys           = new Dictionary <string, string> {
            { OpenIAB_Android.STORE_GOOGLE, publicKey }
        };

        // Transmit options and start the service
        OpenIAB.init(options);
    }
예제 #3
0
        public void Restore()
        {
            WriteLog("starting restore...");

            if (_state == State.Busy)
            {
                CompleteTask(Failed, "can't restore purchases", "busy");
            }
            else
            {
                _sku   = null;
                _state = State.Busy;

                if (_state == State.Ready)
                {
                    WriteLog("quering inventory...");
                    OpenIAB.queryInventory();
                }
                else
                {
                    WriteLog("initializing OpenIAB...");
                    OpenIAB.init(_options);
                }
            }
        }
예제 #4
0
        public void PurchaseProduct(string sku)
        {
            WriteLog("starting purchase: {0}", sku);

            if (_state == State.Busy)
            {
                CompleteTask(Failed, "can't purchase product", "busy");
            }
            else
            {
                _sku   = sku;
                _state = State.Busy;

                if (_state == State.Ready)
                {
                    WriteLog("quering inventory...");
                    OpenIAB.queryInventory();
                }
                else
                {
                    WriteLog("initializing OpenIAB...");
                    OpenIAB.init(_options);
                }
            }
        }
예제 #5
0
    private void Start()
    {
        if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)                 //OpenIAB.IsCurrentPlatformSupported () deprecated?
        {
            // Map SKUs for iOS
            OpenIAB.mapSku(SKU_SMALL_GEM, OpenIAB_iOS.STORE, "small_gem_bundle");
            OpenIAB.mapSku(SKU_MED_GEM, OpenIAB_iOS.STORE, "medium_gem_bundle");
            OpenIAB.mapSku(SKU_LARGE_GEM, OpenIAB_iOS.STORE, "large_gem_bundle");
            OpenIAB.mapSku(SKU_XLARGE_GEM, OpenIAB_iOS.STORE, "extralarge_gem_bundle");
            OpenIAB.mapSku(SKU_MEGA_GEM, OpenIAB_iOS.STORE, "mega_gem_bundle");
            OpenIAB.mapSku(SKU_EPIC_GEM, OpenIAB_iOS.STORE, "epic_gem_bundle");

            // Map SKUs for Google Play
            OpenIAB.mapSku(SKU_SMALL_GEM, OpenIAB_Android.STORE_GOOGLE, "small_gem_bundle");
            OpenIAB.mapSku(SKU_MED_GEM, OpenIAB_Android.STORE_GOOGLE, "medium_gem_bundle");
            OpenIAB.mapSku(SKU_LARGE_GEM, OpenIAB_Android.STORE_GOOGLE, "large_gem_bundle");
            OpenIAB.mapSku(SKU_XLARGE_GEM, OpenIAB_Android.STORE_GOOGLE, "extralarge_gem_bundle");
            OpenIAB.mapSku(SKU_MEGA_GEM, OpenIAB_Android.STORE_GOOGLE, "mega_gem_bundle");
            OpenIAB.mapSku(SKU_EPIC_GEM, OpenIAB_Android.STORE_GOOGLE, "epic_gem_bundle");



            //Set some library options
            var options = new OnePF.Options();

            //Add Google Play public key
            options.storeKeys.Add(OpenIAB_Android.STORE_GOOGLE, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqAgfUKWZ1AFrZa8ot6plf2XCambRZE7EvNpeuENdmMSmN+sloTelHoceCkqkdM//J+caBUbuj1DayZkcmUbFnShPZpI8/9/71fkwY33SvsSjMtoeK5l7vK122WqvLprbaAVF8yvQDLyBJpaVUfpsHH2kOjszGa9XORHMSUqc6qDjSWjkf0FaA+qBc/ffrnCWOu2adlhd3grwEsS6sFEb0XyaNsHN8lq38S7GokHOlI1ehMjf9WtpZaafLjNHkEEu+FdVEIRf6PSUUcwEqdkhy8yucYlLEAvhVEX/oXF9U9Mk9St3FHOxRvQwqZzjoGz+cxmSlQvUM0vAIQhKIgSnYQIDAQAB");
            OpenIAB.init(options);
        }
        else
        {
            Debug.Log("-- IAP -- Not Supported on this platform --");
        }
    }
예제 #6
0
    private void Start()
    {
        // Map skus for different stores
        OpenIAB.mapSku("package1", OpenIAB_Android.STORE_GOOGLE, "package1");
        OpenIAB.mapSku("package2", OpenIAB_Android.STORE_GOOGLE, "package2");
        OpenIAB.mapSku("package3", OpenIAB_Android.STORE_GOOGLE, "package3");
        OpenIAB.mapSku("package4", OpenIAB_Android.STORE_GOOGLE, "package4");
        OpenIAB.mapSku("package5", OpenIAB_Android.STORE_GOOGLE, "package5");
        OpenIAB.mapSku("package6", OpenIAB_Android.STORE_GOOGLE, "package6");

        //OpenIAB.mapSku(SKU, OpenIAB_iOS.STORE, "sku");
        //OpenIAB.mapSku(SKU, OpenIAB_WP8.STORE, "ammo");

        //Khoi tao inapp
        // Application public key
        if (!_isInitialized)
        {
            var publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlokcbayM/caK81xQ42EPWpiJlPe+NAQ4DYA+Z+amaCP4cLANurjyBYbqF5KisMPzb3XG6TjXHMU3uBMPXHgj5LSLFFTsZDTSZeUNZ22nX9o7U/EwHdxr0ofjC/zZAnzLFQxs8U+Nh5zk7/5xDnmoWdhvuGMxWo4i8lk/2rYWfnYJ/+uXPYK9Z7usTE3eL5fj33JYrPGE3friJ03/l3t3YY7zyR9OoIKCXaXtCzmNHX1kRozn7FpsNec3Ne4qoFDAnWnb219b7Cao9rWjbUZ5XJEqcGwCBZCRwZEw2Nl2li/Mk2txogHPGLBI3RWWEWIcBsVbYFb95bb8AyOB92eyywIDAQAB";
            var options   = new Options();
            options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
            options.discoveryTimeoutMs      = Options.DISCOVER_TIMEOUT_MS * 2;
            options.checkInventory          = false;
            options.verifyMode          = OptionsVerifyMode.VERIFY_SKIP;
            options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE };
            options.availableStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE };
            options.storeKeys           = new Dictionary <string, string> {
                { OpenIAB_Android.STORE_GOOGLE, publicKey }
            };
            options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;

            // Transmit options and start the service
            OpenIAB.init(options);
        }
    }
예제 #7
0
    private void Start()
    {
        #if UNITY_ANDROID || UNITY_IOS || UNITY_WP8
        // Map skus for different stores
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "sku");
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_AMAZON, "sku");
        OpenIAB.mapSku(SKU, OpenIAB_iOS.STORE, "sku");
        //    OpenIAB.mapSku( SKU, OpenIAB_WP8.STORE, "sku" );

        OpenIAB.mapSku(LevelManager.THIS.InAppIDs[0], OpenIAB_iOS.STORE, LevelManager.THIS.InAppIDs[0]);
        OpenIAB.mapSku(LevelManager.THIS.InAppIDs[1], OpenIAB_iOS.STORE, LevelManager.THIS.InAppIDs[1]);
        OpenIAB.mapSku(LevelManager.THIS.InAppIDs[2], OpenIAB_iOS.STORE, LevelManager.THIS.InAppIDs[2]);
        OpenIAB.mapSku(LevelManager.THIS.InAppIDs[3], OpenIAB_iOS.STORE, LevelManager.THIS.InAppIDs[3]);

        var publicKey = LevelManager.THIS.GoogleLicenseKey;

        var options = new Options();
        options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
        options.discoveryTimeoutMs      = Options.DISCOVER_TIMEOUT_MS * 2;
        options.checkInventory          = false;
        options.verifyMode          = OptionsVerifyMode.VERIFY_SKIP;
        options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE };
        options.storeKeys           = new Dictionary <string, string> {
            { OpenIAB_Android.STORE_GOOGLE, publicKey }
        };
        options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;
        // Transmit options and start the service
        OpenIAB.init(options);
    #endif
    }
예제 #8
0
    // Use this for initialization
    void Start()
    {
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "no_ads");
        var options = new OnePF.Options();

        options.storeKeys.Add(OpenIAB_Android.STORE_GOOGLE, googleKey);
        OpenIAB.init(options);
    }
예제 #9
0
    //-------------------------------------------------------------------------
    public void initInventory(List <string> list_inventorysku)
    {
        foreach (var i in list_inventorysku)
        {
            OpenIAB.mapSku(i, OpenIAB_iOS.STORE, i);
        }

        var options = new Options();

        OpenIAB.init(options);
    }
예제 #10
0
 private void Start()
 {
     LoadData();
     OpenIAB.init(new Dictionary <string, string> {
         { OpenIAB.STORE_GOOGLE, "" },
         { OpenIAB.STORE_AMAZON, "" },
         { OpenIAB.STORE_TSTORE, "" },
         { OpenIAB.STORE_SAMSUNG, "" },
         { OpenIAB.STORE_YANDEX, "" }
     });
 }
예제 #11
0
파일: Pay.cs 프로젝트: cyecp/GF.UnityNative
    //-------------------------------------------------------------------------
    public void initInventory(List <int> list_inventory)
    {
        Debug.LogError("Pay::initInventory");
        foreach (var i in list_inventory)
        {
            OpenIAB.mapSku(i.ToString(), OpenIAB_iOS.STORE, i.ToString());
        }

        var options = new Options();

        OpenIAB.init(options);
    }
예제 #12
0
    void Start()
    {
        OpenIAB.mapSku(SKU_10, OpenIAB_Android.STORE_GOOGLE, "buy10k_coin");
        OpenIAB.mapSku(SKU_50, OpenIAB_Android.STORE_GOOGLE, "buy50k_coin");
        OpenIAB.mapSku(SKU_100, OpenIAB_Android.STORE_GOOGLE, "buy100k_coin");
        OpenIAB.mapSku(SKU_Life, OpenIAB_Android.STORE_GOOGLE, "buylife");
        var options = new OnePF.Options();

        options.checkInventory = false;
        options.verifyMode     = OptionsVerifyMode.VERIFY_SKIP;
        options.storeKeys.Add(OpenIAB_Android.STORE_GOOGLE, googleKey);
        OpenIAB.init(options);
    }
    // Use this for initialization
    public void Start()
    {
        // Set some library options
        var options = new OnePF.Options();

        options.checkInventory = false;         //hanya jalan di android saja
        options.verifyMode     = OptionsVerifyMode.VERIFY_SKIP;

        // Add Google Play public key
        options.storeKeys.Add(OpenIAB_Android.STORE_GOOGLE, GOOGLE_KEY);

        OpenIAB.init(options);
    }
예제 #14
0
    private void Start()
    {
        OpenIAB.mapSku(SKU_MEDKIT, STORE_ONEPF, "onepf.sku_medkit");
        OpenIAB.mapSku(SKU_AMMO, STORE_ONEPF, "onepf.sku_ammo");
        OpenIAB.mapSku(SKU_COWBOY_HAT, STORE_ONEPF, "onepf.sku_cowboy_hat");
        OpenIAB.mapSku(SKU_INFINITE_AMMO, STORE_ONEPF, "onepf.sku_infinite_ammo");

        OpenIAB.init(new Dictionary <string, string> {
            { OpenIAB.STORE_AMAZON, "c18a8ce946f646999c35b3da532aa9e3" },
            { OpenIAB.STORE_GOOGLE, "" },
            { OpenIAB.STORE_TSTORE, "" },
            { OpenIAB.STORE_SAMSUNG, "" },
            { OpenIAB.STORE_YANDEX, "" }
        });
    }
예제 #15
0
    void Start()
    {
        OpenIAB.mapSku(SKU_money_10k, OpenIAB_Android.STORE_GOOGLE, "money_10k");
        OpenIAB.mapSku(SKU_money_25k, OpenIAB_Android.STORE_GOOGLE, "money_25k");
        OpenIAB.mapSku(SKU_money_50k, OpenIAB_Android.STORE_GOOGLE, "money_50k");
        OpenIAB.mapSku(SKU_money_100k, OpenIAB_Android.STORE_GOOGLE, "money_100k");
        OpenIAB.mapSku(SKU_money_1mln, OpenIAB_Android.STORE_GOOGLE, "money_1mln");

        var options = new OnePF.Options();

        options.storeKeys.Add(OpenIAB_Android.STORE_GOOGLE, googleKey);
        OpenIAB.init(options);

        //OpenIAB.consumeProduct();
        input_script = GameObject.Find("MobileInput").GetComponent <InputManager>();
    }
예제 #16
0
    void InitOpenIAB()
    {
        var googlePublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjGg+p9dYT3X41S8CwJCsdilPjhiLzvdVL2CBT/APh3Nkk4fiFs6cpqecgl+H9h9SmbPhWJ8qrWDiTTV1bLKtlEI4lQkCJ5U8nT13Z6U7VmP7h1A+DHyvEvvF3ox7kZmY4x9LCypHav/7DsS88eWA0zLFm8+juqBprPsGupy6JasSibvC0MWWIcvl3vJ5LCQKppP/1BJV+IE7Y8s0NQFwI2ZcgprFBsqQr/h2r9+zFAcS7D0WtiJq/jS/PJqav/6bXo5UWVXmZCfC6GavucIKybOdybNbb/K0MXqph6MkPaqgYT+If9h/Vlt8tIafWE6SuKtFMk0I8XbqdAfpFbgkzQIDAQAB/uhGQaCoZO/I+fhgpfiwKkDRf+STIWSvJyuSK3GipO7EnADSlAIa1l+dGGL+7fsAuEV+sp0cQOfWSsELB9t9TnEsA3g9lHz4z7EsdiyPl/GOr0ei3KHdGM3t20pqVE/hy48de7daiiKbgg9po99J8bVcZktLwbqc12H1WsCjDYsJjRMz5uDGttFHv1/xojkbqgbsolJK3GcaUhj0z6tkmRxZo64z9LI1TxjaDt3p+mDQxTFBpY0V1mb1BcSAY9ko3rEJes37TEi7HNZCvzrRZGBTfKB62OsQIDAQAB";

        var options = new Options();

        options.storeKeys = new Dictionary <string, string> {
            { OpenIAB_Android.STORE_GOOGLE, googlePublicKey }
        };
        //options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
        //options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2;
        //options.checkInventory = false;
        options.verifyMode          = OptionsVerifyMode.VERIFY_SKIP;
        options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;

        OpenIAB.init(options);
    }
예제 #17
0
    //const string SKU_AdRemove = "com.fss.removead";

    private void Start()
    {
        instance = this;
        //OpenIAB.mapSku (SKU, OpenIAB_iOS.STORE, "fbss");
        OpenIAB.mapSku(PluginManager._insta.inAppRemoveAdID, OpenIAB_iOS.STORE, PluginManager._insta.inAppRemoveAdID);
        OpenIAB.mapSku(PluginManager._insta.inAppRemoveAdID, OpenIAB_Android.STORE_GOOGLE, PluginManager._insta.inAppRemoveAdID);

        var options = new Options();

        options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
        options.discoveryTimeoutMs      = Options.DISCOVER_TIMEOUT_MS * 2;
        options.checkInventory          = false;
        options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
        options.storeKeys  = new Dictionary <string, string> {
            { OpenIAB_Android.STORE_GOOGLE, PluginManager._insta.publicKeyAndroid }
        };
        OpenIAB.init(options);
    }
예제 #18
0
    private void Start()
    {
        // SKU's for iOS MUST be mapped. Mappings for other stores are optional
        OpenIAB.mapSku(SKU_MEDKIT, OpenIAB_iOS.STORE, "30_real");
        OpenIAB.mapSku(SKU_AMMO, OpenIAB_iOS.STORE, "75_real");
        OpenIAB.mapSku(SKU_INFINITE_AMMO, OpenIAB_iOS.STORE, "noncons_2");
        OpenIAB.mapSku(SKU_COWBOY_HAT, OpenIAB_iOS.STORE, "noncons_1");

        OpenIAB.mapSku(SKU_MEDKIT, STORE_ONEPF, "onepf.sku_medkit");
        OpenIAB.mapSku(SKU_AMMO, STORE_ONEPF, "onepf.sku_ammo");
        OpenIAB.mapSku(SKU_COWBOY_HAT, STORE_ONEPF, "onepf.sku_cowboy_hat");
        OpenIAB.mapSku(SKU_INFINITE_AMMO, STORE_ONEPF, "onepf.sku_infinite_ammo");

        var options = new OnePF.Options();

        options.storeKeys.Add(OpenIAB_Android.STORE_GOOGLE, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtKiFBiESx95DM1B6acfQVSns4fHR8wwvwzvHTwYac2TWEBdTkvn2tmZwu61NYrp2Puq1qHfgRM2M1pZcfmtUcDwTInP7uD5Gebom8MrOQfC6L8gMj9uksq1MyYq3vhkcHibKhpF47iaLvWsSnzYuwZ0iWGYh71OA2G7S28D1ikQdG+pzJdw9eFi6W+Gmfo0INII30npkNHwxnDv9wZ+eGqvp5M/JqZF3O3p8kjvsUb2IQj7eZlvSAhM/Z2p5XdSi1Os1r2Xu4um0Wv2HcgcbfCJqBwruuZVE+51zyPUMRYkm2/Nv9MyIEHmejvo0wHRmW1iuUzbwgEnkJYxPRqVUKwIDAQAB");
        OpenIAB.init(options);
    }
예제 #19
0
    private void Start()
    {
        // Map skus for different stores
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "missileman.paid");
        //OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "android.test.purchased");

        var public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqibEPHCtfPm3Rn26gbE6vhCc1d6A072im+oWNlkUAJYV//pt1vCkYLqkkw/P2esPSWaw1nt66650vfVYc3sYY6L782n/C+IvZWQt0EaLrqsSoNfN5VqPhPeGf3wqsOvbKw9YqZWyKL4ddZUzRUPex5xIzjHHm3qIJI5v7iFJHOxOj0bLuEG8lH0Ljt/w2bNe4o0XXoshYDqpzIKmKy6OYNQOs8iBTJlfSmPrlGudmldW6CsuAKeVGm+Z+2xx3Xxsx3eSwEgEaUc1ZsMWSGsV6dXgc3JrUvK23JRJUu8X5Ec1OQLyxL3VelD5f0iKVTJ1kw59tMAVZ7DDpzPggWpUkwIDAQAB";

        var options = new Options();

        options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
        options.storeKeys  = new Dictionary <string, string> {
            { OpenIAB_Android.STORE_GOOGLE, public_key }
        };

        // Transmit options and start the service
        OpenIAB.init(options);
    }
예제 #20
0
    public void Initialize()
    {
        OpenIABEventManager.purchaseSucceededEvent += OnPurchaseSucceeded;

        OpenIAB.mapSku("buyshe", OpenIAB_Android.STORE_GOOGLE, "buyshe");

        var googlePublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiaoqnY/8dixib9ZY1sYPfBvdc8uhGMZ24HYDGbgtpBiHR5aZ5LuQ9eJgfRLnXeCMZVVD5IqWBtehjTtoq2xsD+yvauYX7mTboq5OEEVwTBfkXYRsGyuIV9CBRBY+2sCE9fGGIu+LwTFA+SucXh3r10J4scANSIINV7VXgqg8AK7xTmU70IwkQwHg2271uIlSHaDpKPXYkYHvo4IifyWOxTE3uiwX4I/RP0IIhRph/zNwGDY6VnhVxjsCS8Ua0EfVdONCLFOiwNitfjdZ22OiAVVfL8aFllVSbGQrC6mzJTtjuSySp+Suu6ZbU+16fmzwFkolybV0ibChNg/ajY3X1QIDAQAB";

        var options = new Options();

        options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
        options.discoveryTimeoutMs      = Options.DISCOVER_TIMEOUT_MS * 2;
        options.checkInventory          = false;
        options.verifyMode          = OptionsVerifyMode.VERIFY_SKIP;
        options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE };
        options.availableStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE };
        options.storeKeys           = new Dictionary <string, string> {
            { OpenIAB_Android.STORE_GOOGLE, googlePublicKey }
        };
        options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;

        OpenIAB.init(options);
    }
예제 #21
0
    void init()
    {
        // Application public key
        var googlePublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjN/yjT//IzEY3Jl8hClmpsCst+gDXR1GSu1fTJ132Gusw9YJ4h2pSYHkF9HYRlg2MZ9wZCmZ0iedUfw08XSeOdcjVklLexlgJW2FU64y+pHmp9gIxs6nQvvdm4xkC+TT2eTCYG1/rYSwTdM834UgwxGMAcdVK+HykRJrTpR1i0t2w9iiYWYcYnLscw2bGv1BgtFVjLJdrBqelejvqjDq/xRQGx0K5zXhZltEF+fik71dzAZ7GvxT2ckNu3z6BYrNMUznNepW33Hlo4Hk+ZAPeh3o3NG/TZr6lZIii9ZO18emwhYOvwYCMWS1F+8ECMiXVma2R7/0eH1P5ZETOsLcjQIDAQAB";

        var options = new Options();

        //options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
        //options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2;
        //options.checkInventory = false;
        //options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
        options.storeKeys = new Dictionary <string, string> {
            { OpenIAB_Android.STORE_GOOGLE, googlePublicKey }
        };
        //options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;
        options.availableStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE };
        options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE };
        options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;
        // Transmit options and start the service
        OpenIAB.init(options);

        //query inventory
        //OpenIAB.queryInventory(new string[] { SKU });
    }
예제 #22
0
        // initialize IAPs, billing systems and database,
        // as well as shop components in this order
        void Awake()
        {
            //make sure we keep one instance of this script in the game
            if (instance)
            {
                Destroy(gameObject);
                return;
            }
            DontDestroyOnLoad(this);

            //ensure that we are always developing on a mobile platform,
            //otherwise print a warning
                        #if !UNITY_ANDROID && !UNITY_IPHONE && !UNITY_WP8
            Debug.LogWarning("IAPManager: Detected non-mobile platform. Purchases for real money are"
                             + " not supported on this platform. Please switch to iOS/Android/WP8.");
                        #endif

            //set static reference
            instance = this;
            //populate IAP dictionary and arrays with product ids
            InitIds();

            //map delegates to fire corresponding methods
            OpenIABEventManager.billingSupportedEvent         += RequestProductData;
            OpenIABEventManager.billingNotSupportedEvent      += BillingNotSupported;
            OpenIABEventManager.queryInventorySucceededEvent  += ProductDataReceived;
            OpenIABEventManager.queryInventoryFailedEvent     += BillingNotSupported;
            OpenIABEventManager.purchaseSucceededEvent        += PurchaseSucceeded;
            OpenIABEventManager.purchaseFailedEvent           += PurchaseFailed;
            OpenIABEventManager.consumePurchaseSucceededEvent += ConsumeSucceeded;
            OpenIABEventManager.consumePurchaseFailedEvent    += PurchaseFailed;
            //iOS only
            OpenIABEventManager.transactionRestoredEvent += TransactionRestored;
            OpenIABEventManager.restoreSucceededEvent    += RestoreSucceeded;
            OpenIABEventManager.restoreFailedEvent       += RestoreFailed;

            Options opt = new Options();
            opt.verifyMode          = OptionsVerifyMode.VERIFY_SKIP;
            opt.storeSearchStrategy = SearchStrategy.BEST_FIT;

            opt.prefferedStoreNames = new string[]
            {
                OpenIAB_Android.STORE_GOOGLE,
                OpenIAB_Android.STORE_AMAZON,
                OpenIAB_iOS.STORE,
                OpenIAB_WP8.STORE
            };

            opt.storeKeys = new Dictionary <string, string>
            {
                { OpenIAB_Android.STORE_GOOGLE, googleStoreKey }
            };

            //map sku for different stores
                        #if UNITY_ANDROID
            string currentStore = OpenIAB_Android.STORE_GOOGLE;
            if (androidPlatform == IAPPlatform.Amazon)
            {
                currentStore = OpenIAB_Android.STORE_AMAZON;
            }
                        #elif UNITY_IPHONE
            string currentStore = OpenIAB_iOS.STORE;
            #elif UNITY_WP8
            string currentStore = OpenIAB_WP8.STORE;
                        #endif

            //initializes the billing system
            #if !UNITY_STANDALONE && !UNITY_WEBPLAYER
            for (int i = 0; i < ids.Length; i++)
            {
                OpenIAB.mapSku(ids[i], currentStore, ids[i]);
            }

                                #if UNITY_ANDROID
            if (androidPlatform == IAPPlatform.GooglePlay && string.IsNullOrEmpty(googleStoreKey))
            {
                Debug.LogWarning("IAPManager: Google Store Key missing on IAP Manager prefab. "
                                 + "Purchases for real money won't be supported on the device.");
            }
            else
            {
                OpenIAB.init(opt);
            }
                                #else
            OpenIAB.init(opt);
                                #endif
            #endif

            //initialize database, remote and shop managers
            GetComponent <DBManager>().Init();
            StartCoroutine(RemoteDownload());
            OnLevelWasLoaded(-1);
        }
예제 #23
0
    private void OnGUI()
    {
        _column = 0;
        _row    = 0;

        GUI.skin.button.fontSize = (Screen.width >= SMALL_SCREEN_SIZE || Screen.height >= SMALL_SCREEN_SIZE) ? LARGE_FONT_SIZE : SMALL_FONT_SIZE;

        if (Button("Initialize OpenIAB"))
        {
            // Application public key
            var googlePublicKey  = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgEEaiFfxugLWAH4CQqXYttXlj3GI2ozlcnWlZDaO2VYkcUhbrAz368FMmw2g40zgIDfyopFqETXf0dMTDw7VH3JOXZID2ATtTfBXaU4hqTf2lSwcY9RXe/Uz0x1nf1oLAf85oWZ7uuXScR747ekzRZB4vb4afm2DsbE30ohZD/WzQ22xByX6583yYE19RdE9yJzFckEPlHuOeMgKOa4WErt11PHB6FTdT5eN96/jjjeEoYhX/NGkOWKW0Y0T0A7CdUC0D4t2xxkzAQHdgLfcRw9+/EIcaysLhncWYiCifJrRBGpqZU1IrNuehrC5FXUN99786c/TwlxNG5nflE6sWwIDAQAB";
            var yandexPublicKey  = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApvU8l4ONEEsSGznPN6DnjIbJnv6vEgm08nbbi+2fMc0V46N7x7jBWTWAf2K6XLZg/rLUkqbWISq12PLvt7ydcsD+Hb9ZubdN2h8LNCTohVPeDbJjd5khtF4J5FNP2/XSTc1C7cSCBTGmqH0fUr77v4x/JMpxKlSjPN6KbNnaF2BLDAdi3012lz2XX4BVgUj7LArID/vYSYGlwMzMkvhUSpvZOM/WIPN+8YDgQAFBlRGRjLhY/3Vpq/AtXtVAzzyfTOZYkwNqdXpwAq5+/51LphowUI5NEBYh8lhQeOJmPNA6EcF1h5L9cJTVLy3bkuCXcjoN2eEO1Nq0h/40G0R4pwIDAQAB";
            var slideMePublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAogOQb0mMbuq4FQ4ZhWRhN8k76/gXOUE370VubZa9Up25GdptYXoRNniecUTDLyjfvWp7+YFW8iPqIp523qNXtQ0EynNhK4xNLvJCd1CjfAju6M0f+o8MOL1zV7g3dHqxICZoHwqBbQOWneDzG/DzJ22AVdLKwty0qbv8ESaCOCJe31ZnoYVMw5KNVkSuRrrhiGGh6xj7F3qZ0T5TOSp3fK7soDamQLevuU7Ndn5IQACjo92HNN0O2PR2cvEjkCRuIkNk2hnqinac984JCzCC0SC/JBnUZUAeYJ7Y8sjT+79z1T1g7yGgDesopnqORiBkeXEZHrFy7PifdA/ZX7rRwQIDAQAB";

            var options = new Options();
            options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
            options.discoveryTimeoutMs      = Options.DISCOVER_TIMEOUT_MS * 2;
            options.checkInventory          = false;
            options.verifyMode          = OptionsVerifyMode.VERIFY_SKIP;
            options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_AMAZON };
            options.availableStoreNames = new string[] { OpenIAB_Android.STORE_AMAZON };
            options.storeKeys           = new Dictionary <string, string> {
                { OpenIAB_Android.STORE_GOOGLE, googlePublicKey }
            };
            options.storeKeys = new Dictionary <string, string> {
                { OpenIAB_Android.STORE_YANDEX, yandexPublicKey }
            };
            options.storeKeys = new Dictionary <string, string> {
                { OpenIAB_Android.STORE_SLIDEME, slideMePublicKey }
            };
            options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;

            // Transmit options and start the service
            OpenIAB.init(options);
        }

        if (!_isInitialized)
        {
            return;
        }

        if (Button("Query Inventory"))
        {
            OpenIAB.queryInventory(new string[] { SKU });
        }

        if (Button("Purchase Product"))
        {
            OpenIAB.purchaseProduct(SKU);
        }

        if (Button("Consume Product"))
        {
            if (_inventory != null && _inventory.HasPurchase(SKU))
            {
                OpenIAB.consumeProduct(_inventory.GetPurchase(SKU));
            }
        }

// Android specific buttons
#if UNITY_ANDROID
        if (Button("Test Purchase"))
        {
            OpenIAB.purchaseProduct("android.test.purchased");
        }

        if (Button("Test Consume"))
        {
            if (_inventory != null && _inventory.HasPurchase("android.test.purchased"))
            {
                OpenIAB.consumeProduct(_inventory.GetPurchase("android.test.purchased"));
            }
        }

        if (Button("Test Item Unavailable"))
        {
            OpenIAB.purchaseProduct("android.test.item_unavailable");
        }

        if (Button("Test Purchase Canceled"))
        {
            OpenIAB.purchaseProduct("android.test.canceled");
        }
#endif
    }
예제 #24
0
    private void OnGUI()
    {
        _column = 0;
        _row    = 0;

        GUI.skin.button.fontSize = (Screen.width >= SMALL_SCREEN_SIZE || Screen.height >= SMALL_SCREEN_SIZE) ? LARGE_FONT_SIZE : SMALL_FONT_SIZE;

        if (Button("Initialize OpenIAB"))
        {
            // Application public key
            var publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgEEaiFfxugLWAH4CQqXYttXlj3GI2ozlcnWlZDaO2VYkcUhbrAz368FMmw2g40zgIDfyopFqETXf0dMTDw7VH3JOXZID2ATtTfBXaU4hqTf2lSwcY9RXe/Uz0x1nf1oLAf85oWZ7uuXScR747ekzRZB4vb4afm2DsbE30ohZD/WzQ22xByX6583yYE19RdE9yJzFckEPlHuOeMgKOa4WErt11PHB6FTdT5eN96/jjjeEoYhX/NGkOWKW0Y0T0A7CdUC0D4t2xxkzAQHdgLfcRw9+/EIcaysLhncWYiCifJrRBGpqZU1IrNuehrC5FXUN99786c/TwlxNG5nflE6sWwIDAQAB";

            var options = new Options();
            options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
            options.discoveryTimeoutMs      = Options.DISCOVER_TIMEOUT_MS * 2;
            options.checkInventory          = false;
            options.verifyMode          = OptionsVerifyMode.VERIFY_SKIP;
            options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE };
            options.availableStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE };
            options.storeKeys           = new Dictionary <string, string> {
                { OpenIAB_Android.STORE_GOOGLE, publicKey }
            };
            options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;

            // Transmit options and start the service
            OpenIAB.init(options);
        }

        if (!_isInitialized)
        {
            return;
        }

        if (Button("Query Inventory"))
        {
            OpenIAB.queryInventory(new string[] { SKU });
        }

        if (Button("Purchase Product"))
        {
            OpenIAB.purchaseProduct(SKU);
        }

        if (Button("Consume Product"))
        {
            if (_inventory != null && _inventory.HasPurchase(SKU))
            {
                OpenIAB.consumeProduct(_inventory.GetPurchase(SKU));
            }
        }

// Android specific buttons
#if UNITY_ANDROID
        if (Button("Test Purchase"))
        {
            OpenIAB.purchaseProduct("android.test.purchased");
        }

        if (Button("Test Consume"))
        {
            if (_inventory != null && _inventory.HasPurchase("android.test.purchased"))
            {
                OpenIAB.consumeProduct(_inventory.GetPurchase("android.test.purchased"));
            }
        }

        if (Button("Test Item Unavailable"))
        {
            OpenIAB.purchaseProduct("android.test.item_unavailable");
        }

        if (Button("Test Purchase Canceled"))
        {
            OpenIAB.purchaseProduct("android.test.canceled");
        }
#endif
    }
    private void OnGUI()
    {
        _column = 0;
        _row    = 0;

        GUI.skin.button.fontSize = (Screen.width >= SMALL_SCREEN_SIZE || Screen.height >= SMALL_SCREEN_SIZE) ? LARGE_FONT_SIZE : SMALL_FONT_SIZE;

        if (Button("Initialize OpenIAB"))
        {
            // Application public key
            var publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqibEPHCtfPm3Rn26gbE6vhCc1d6A072im+oWNlkUAJYV//pt1vCkYLqkkw/P2esPSWaw1nt66650vfVYc3sYY6L782n/C+IvZWQt0EaLrqsSoNfN5VqPhPeGf3wqsOvbKw9YqZWyKL4ddZUzRUPex5xIzjHHm3qIJI5v7iFJHOxOj0bLuEG8lH0Ljt/w2bNe4o0XXoshYDqpzIKmKy6OYNQOs8iBTJlfSmPrlGudmldW6CsuAKeVGm+Z+2xx3Xxsx3eSwEgEaUc1ZsMWSGsV6dXgc3JrUvK23JRJUu8X5Ec1OQLyxL3VelD5f0iKVTJ1kw59tMAVZ7DDpzPggWpUkwIDAQAB";

            var options = new Options();
            options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
            options.storeKeys  = new Dictionary <string, string> {
                { OpenIAB_Android.STORE_GOOGLE, publicKey }
            };

            // Transmit options and start the service
            OpenIAB.init(options);
        }

        if (!_isInitialized)
        {
            return;
        }

        if (Button("Query Inventory"))
        {
            OpenIAB.queryInventory(new string[] { SKU });
        }

        if (Button("Purchase Product"))
        {
            OpenIAB.purchaseProduct(SKU);
        }

        if (Button("Consume Product"))
        {
            OpenIAB.consumeProduct(Purchase.CreateFromSku(SKU));
        }

// Android specific buttons
#if UNITY_ANDROID
        if (Button("Test Purchase"))
        {
            OpenIAB.purchaseProduct("android.test.purchased");
        }

        if (Button("Test Refund"))
        {
            OpenIAB.purchaseProduct("android.test.refunded");
        }

        if (Button("Test Item Unavailable"))
        {
            OpenIAB.purchaseProduct("android.test.item_unavailable");
        }

        if (Button("Test Purchase Canceled"))
        {
            OpenIAB.purchaseProduct("android.test.canceled");
        }
#endif
    }
예제 #26
0
    private void OnGUI()
    {
        float yPos       = 5.0f;
        float xPos       = 5.0f;
        float width      = (Screen.width >= 800 || Screen.height >= 800) ? 320 : 160;
        float height     = (Screen.width >= 800 || Screen.height >= 800) ? 80 : 40;
        float heightPlus = height + 10.0f;

        if (GUI.Button(new Rect(xPos, yPos, width, height), "Initialize OpenIAB"))
        {
            // Application public key
            var public_key = "key";

            var options = new Options();
            options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
            options.storeKeys  = new Dictionary <string, string> {
                { OpenIAB_Android.STORE_GOOGLE, public_key }
            };

            // Transmit options and start the service
            OpenIAB.init(options);
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Test Purchase"))
        {
            OpenIAB.purchaseProduct("android.test.purchased");
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Test Refund"))
        {
            OpenIAB.purchaseProduct("android.test.refunded");
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Test Item Unavailable"))
        {
            OpenIAB.purchaseProduct("android.test.item_unavailable");
        }

        xPos = Screen.width - width - 5.0f;
        yPos = 5.0f;

        if (GUI.Button(new Rect(xPos, yPos, width, height), "Test Purchase Canceled"))
        {
            OpenIAB.purchaseProduct("android.test.canceled");
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Query Inventory"))
        {
            OpenIAB.queryInventory();
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Purchase Real Product"))
        {
            OpenIAB.purchaseProduct(SKU);
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Stop Billing Service"))
        {
            OpenIAB.unbindService();
        }
    }
예제 #27
0
    private void OnGUI()
    {
        float yPos       = 5.0f;
        float xPos       = 5.0f;
        float width      = (Screen.width >= 800 || Screen.height >= 800) ? 320 : 160;
        float height     = (Screen.width >= 800 || Screen.height >= 800) ? 80 : 40;
        float heightPlus = height + 10.0f;

        if (GUI.Button(new Rect(xPos, yPos, width, height), "Initialize OpenIAB"))
        {
            // Application public key
            var public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqibEPHCtfPm3Rn26gbE6vhCc1d6A072im+oWNlkUAJYV//pt1vCkYLqkkw/P2esPSWaw1nt66650vfVYc3sYY6L782n/C+IvZWQt0EaLrqsSoNfN5VqPhPeGf3wqsOvbKw9YqZWyKL4ddZUzRUPex5xIzjHHm3qIJI5v7iFJHOxOj0bLuEG8lH0Ljt/w2bNe4o0XXoshYDqpzIKmKy6OYNQOs8iBTJlfSmPrlGudmldW6CsuAKeVGm+Z+2xx3Xxsx3eSwEgEaUc1ZsMWSGsV6dXgc3JrUvK23JRJUu8X5Ec1OQLyxL3VelD5f0iKVTJ1kw59tMAVZ7DDpzPggWpUkwIDAQAB";

            var options = new Options();
            options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
            options.storeKeys  = new Dictionary <string, string> {
                { OpenIAB_Android.STORE_GOOGLE, public_key }
            };

            // Transmit options and start the service
            OpenIAB.init(options);
        }

        if (!_isInitialized)
        {
            return;
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Test Purchase"))
        {
            OpenIAB.purchaseProduct("android.test.purchased");
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Test Refund"))
        {
            OpenIAB.purchaseProduct("android.test.refunded");
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Test Item Unavailable"))
        {
            OpenIAB.purchaseProduct("android.test.item_unavailable");
        }

        xPos = Screen.width - width - 5.0f;
        yPos = 5.0f;

        if (GUI.Button(new Rect(xPos, yPos, width, height), "Test Purchase Canceled"))
        {
            OpenIAB.purchaseProduct("android.test.canceled");
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Query Inventory"))
        {
            OpenIAB.queryInventory(new string[] { SKU });
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Purchase Real Product"))
        {
            OpenIAB.purchaseProduct(SKU);
        }

        if (GUI.Button(new Rect(xPos, yPos += heightPlus, width, height), "Consume Real Product"))
        {
            OpenIAB.consumeProduct(Purchase.CreateFromSku(SKU));
        }
    }