Beispiel #1
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
    }
    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 --");
        }
    }
Beispiel #3
0
    private void Start()
    {
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "pack.topglobal");
        OpenIAB.mapSku(SKU, OpenIAB_iOS.STORE, "pack.topglobal");

        InitOpenIAB();
    }
Beispiel #4
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);
        }
    }
Beispiel #5
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);
    }
Beispiel #6
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);
    }
Beispiel #7
0
 public void MapSku(string storeName, Dictionary <string, string> map)
 {
     foreach (var sku in map)
     {
         WriteLog("mapping sku: {0}", sku);
         OpenIAB.mapSku(sku.Key, storeName, sku.Value);
     }
 }
Beispiel #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);
    }
Beispiel #9
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, "ammo");
 }
Beispiel #10
0
    private void Start()
    {
        // Map skus for different stores
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "sku");

        OpenIAB.mapSku(SKU_AMMO, OpenIAB_WP8.STORE, "sku_ammo");
        OpenIAB.mapSku(SKU_MEDKIT, OpenIAB_WP8.STORE, "sku_medkit");
        OpenIAB.mapSku(SKU_SUBSCRIPTION, OpenIAB_WP8.STORE, "sku_sub");
    }
Beispiel #11
0
    // Use this for initialization
    private void Start()
    {
#if UNITY_ANDROID
        OpenIAB.mapSku(ItemPurchaseStore.AndroidStore, OpenIAB_Android.STORE_GOOGLE, ItemPurchaseStore.AndroidStore);
#elif UNITY_IOS
        OpenIAB.mapSku(ItemPurchaseStore.IosStore.ToString(), OpenIAB_iOS.STORE, ItemPurchaseStore.IosStore.ToString());
#elif UNITY_WP8
        OpenIAB.mapSku(ItemPurchaseStore.WpStore.ToString(), OpenIAB_WP8.STORE, ItemPurchaseStore.WpStore.ToString());
#endif
    }
Beispiel #12
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);
    }
Beispiel #13
0
    //-------------------------------------------------------------------------
    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);
    }
Beispiel #14
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);
    }
Beispiel #15
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, "" }
        });
    }
Beispiel #16
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>();
    }
Beispiel #17
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);
    }
Beispiel #18
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);
    }
Beispiel #19
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);
    }
Beispiel #20
0
    private void Start()
    {
        OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, SKU);

        init();

        //Consume Product
        //if (_inventory != null && _inventory.HasPurchase(SKU))
        //OpenIAB.consumeProduct(_inventory.GetPurchase(SKU));

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

        //Test Item Unavailable
        //OpenIAB.purchaseProduct("android.test.item_unavailable");

        //Test Purchase Canceled
        //OpenIAB.purchaseProduct("android.test.canceled");
    }
    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);
    }
Beispiel #22
0
 private void Start()
 {
     // Map sku for different stores
     OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "google-play.sku");
     OpenIAB.mapSku(SKU, STORE_CUSTOM, "onepf.sku");
 }
Beispiel #23
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);
        }