我使用 unity 3d 制作一个简单的游戏,仅用于测试 Google 服务,对于 Google play 游戏服务,我使用 googleplayplugin,对于 iab,我使用 soomla 插件。我认为一切配置正确,我在nexus4上安装并启动游戏并成功登录。当我尝试购买我配置的东西时(“正确”?)播放商店弹出窗口出现但我的问题是弹出窗口带有此消息“需要错误身份验证。您必须使用您的 Google 帐户登录”。
我错过了什么?我在这方面浪费了几个小时,请帮忙。我确定,我用我的谷歌个人资料登录,因为我看到了我的名字。这里是关于我试图购买的物品的行
//i define the currency
public VirtualCurrency[] GetCurrencies() {
return new VirtualCurrency[]{HEART};
}
//the pack of currency that can be purchased
public VirtualCurrencyPack[] GetCurrencyPacks() {
return new VirtualCurrencyPack[] {HEART_PACK};
}
//
public const string HEART_ITEM_ID = "heart"; //in-game id
public const string HEART_PACK_PRODUCT_ID = "heart_1"; // the id on the play store
public static VirtualCurrency HEART = new VirtualCurrency(
"HEART", // name
"", // description
HEART_ITEM_ID // item id
);
public static VirtualCurrencyPack HEART_PACK = new VirtualCurrencyPack(
"1 heart", // name
"Add a heart.", // description
"heart_1", // item id
1, // number of currencies in the pack
HEART_ITEM_ID, // the currency associated with this pack
new PurchaseWithMarket(HEART_PACK_PRODUCT_ID, 0.50)
);
我打电话购买
StoreInventory.BuyItem (IAPGoogle.HEART_PACK.ItemId);