下面是一个资产类:
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需要分配。我只是搞不懂我该在哪里用哪一种。
在这里,当我调用buy item MW_ITEM1时,会出现错误:
AndroidJavaException: com.soomla.store.exceptions.VirtualItem NotFoundException:在使用productId=Coin s_50进行搜索时找不到虚拟项
我已经删除了应用程序从设备和重新安装,然后也不工作,同样的错误。我已经从设备中删除了应用程序,更新了应用程序版本,Soomla GetVersion()值构建了它,并使用亚行安装了它,然后它也给了我同样的错误。
我在找人帮忙。谢谢
发布于 2014-09-20 02:38:59
我也有这个问题。在我的例子中,问题是这些项目在谷歌游戏中不活跃。
转到google中的应用程序内购买设置,选择非活动项,并将其更改为活动项。
https://stackoverflow.com/questions/24545162
复制相似问题