IAB在Android游戏中购买时出错

IAB在Android游戏中购买时出错

本文介绍了Soomla IAB在Android游戏中购买时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用unity 3d制作简单的游戏仅用于测试Google服务,Google Play游戏服务使用googleplayplugin和iab soomla插件。
我认为所有配置都是正确的,我安装并成功启动了我的nexus4和
登录游戏。
当我尝试购买我配置的东西(正确?)
弹出存储弹出窗口,但有我的问题
弹出窗口中出现此消息需要错误验证。您必须使用您的Google帐户登录。



我在想什么?即时放松这个小时,plz的帮助。
确定,即时通讯登录与我的谷歌个人资料,因为我看到我的名字。
这里是关于试图购买物品的行

  //我定义货币
public VirtualCurrency [] GetCurrencies(){
返回新的VirtualCurrency [] {HEART};
}
//可以购买的货币包
public VirtualCurrencyPack [] GetCurrencyPacks(){
return new VirtualCurrencyPack [] {HEART_PACK};
}
//
public const string HEART_ITEM_ID =heart; //游戏中的id
public const string HEART_PACK_PRODUCT_ID =heart_1; // play商店中的id

public static VirtualCurrency HEART = new VirtualCurrency(
HEART,//名称
,//描述
HEART_ITEM_ID // item id
);

public static VirtualCurrencyPack HEART_PACK = new VirtualCurrencyPack(
1 heart,// name
Add a heart。,//描述
heart_1, //商品ID
1,//包装中的货币数量
HEART_ITEM_ID,//与此包装相关的货币
new PurchaseWithMarket(HEART_PACK_PRODUCT_ID,0.50)
);

我打电话去购买

  StoreInventory.BuyItem(IAPGoogle.HEART_PACK.ItemId); 


解决方案

代码很好,问题出在Google开发者控制台,为了购买我必须发布的apk,即使它是一个测试版或阿尔法,并在我可以与测试人员批准的帐户测试。


im using unity 3d to make a simple game just for testing Google services, for Google play games services i use googleplayplugin and for iab the soomla plugin.i think all is configured rightly, i install and start the game on my nexus4 andlogin successfully .when i try to buy the thing i configured ("correctly"?)the play store popup comes up but there is my problemthe popup comes with this message "Error Authentication is required. You must log in with your Google Account".

what am i missing?? im loosing hours on this, plz help.im sure,im logged in with my google profile because i see my name.here the line about the item im trying to buy

//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)
    );

and i call to buy with

StoreInventory.BuyItem (IAPGoogle.HEART_PACK.ItemId);
解决方案

the code is good, the problem is on the Google developer console, in order to buy i must publish the apk ,even if it is a beta or Alpha, and after i can test with testers approved accounts.

这篇关于Soomla IAB在Android游戏中购买时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 12:25