0

这是一个资产类:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Soomla.Store;

public class StoreAssets : Soomla.Store.IStoreAssets {

public int GetVersion() {
    return 0;
}

public VirtualCurrency[] GetCurrencies() {
    return new VirtualCurrency[]{MW_ITEM};
}

public VirtualGood[] GetGoods() {
    return new VirtualGood[] {};
}

public VirtualCurrencyPack[] GetCurrencyPacks() {
    return new VirtualCurrencyPack[] {MW_ITEM1,MW_ITEM2,MW_ITEM3};
}

public VirtualCategory[] GetCategories() {
    return new VirtualCategory[]{};
}

public NonConsumableItem[] GetNonConsumableItems() {
    return new NonConsumableItem[]{};
}

public const string ITEMID = "mw_coin";//**NOT GOOGLE PLAY PRODUCT ID**
public const string FIFTY_COINS = "mw1";//**google play store product id**
public const string ONEFIFTY_COINS = "mw2";//**google play store product id**
public const string THREEHUNDRED_COINS = "mw3";//**google play store product id**

public static VirtualCurrency MW_ITEM = new VirtualCurrency ("Coins", "", ITEMID);
public static VirtualCurrencyPack MW_ITEM1 = new VirtualCurrencyPack("Buy 50 Coins", 
                                                                     "Use 50 coins wisely in your game.",
                                                                     "Coins_50",//**NOT GOOGLE PLAY PRODUCT ID**
                                                                     50,
                                                                     ITEMID,
                                                                     new PurchaseWithMarket(FIFTY_COINS,0.99f)
                                                                     );
public static VirtualCurrencyPack MW_ITEM2 = new VirtualCurrencyPack("Buy 150 Coins", 
                                                                     "Use 150 coins wisely in your game.",
                                                                     "Coins_150",//**NOT GOOGLE PLAY PRODUCT ID**
                                                                     150,
                                                                     ITEMID,
                                                                     new PurchaseWithMarket(ONEFIFTY_COINS,1.99f)
                                                                     );
public static VirtualCurrencyPack MW_ITEM3 = new VirtualCurrencyPack("Buy 300 Coins", 
                                                                     "Use 300 coins wisely in your game.",
                                                                     "Coins_300",//**NOT GOOGLE PLAY PRODUCT ID**
                                                                     300,
                                                                     ITEMID,
                                                                     new PurchaseWithMarket(THREEHUNDRED_COINS,2.99f)
                                                                     );

}

Soomla 有很多 IDS 可以分配。我只是很困惑在哪里使用哪个 id。

在这里,当我调用购买商品 MW_ITEM1 时出现错误:

AndroidJavaException:com.soomla.store.exceptions.VirtualItem NotFoundException:使用productId = Coin s_50搜索时未找到虚拟物品

我已经从设备中删除了该应用程序并重新安装,然后也无法正常工作,同样的错误。我已经从设备中删除了应用程序并更新了应用程序版本和 Soomla GetVersion() 值构建它并使用 adb 安装它,然后它也给了我同样的错误。

我正在寻求帮助。谢谢

4

1 回答 1

1

我也有这个问题。就我而言,问题是这些项目在 Google Play 中不活跃。

转到您在 google play 中的应用内购买设置,选择非活动项目,然后将它们更改为活动。

于 2014-09-20T02:38:59.250 回答