我使用 unity 3d 制作了一个简单的游戏,只是为了测试 Google 服务,对于 Google Play 游戏服务,我使用 googleplayplugin,对于 iab,使用 soomla 插件。
我认为所有配置都正确,我在我的 nexus4 上安装并启动游戏并且
登录成功。
当我尝试购买我配置的东西时(“正确”?)
Play 商店弹出窗口出现,但我有问题
弹出窗口带有此消息“需要错误身份验证。您必须使用您的 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);
代码很好,问题出在 Google 开发者控制台上,为了购买,我必须发布 apk,即使它是 beta 或 Alpha,之后我可以使用测试人员批准的帐户进行测试。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)