首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Android游戏中购买Soomla IAB出错

在Android游戏中购买Soomla IAB出错
EN

Stack Overflow用户
提问于 2015-01-14 09:42:15
回答 1查看 1.9K关注 0票数 2

我正在使用unity 3d制作一个简单的游戏,仅用于测试Google服务,对于Google play游戏服务,我使用googleplayplugin,对于iab,我使用soomla插件。我想所有的配置都是正确的,我在我的nexus4上安装并启动了游戏,并成功登录。当我尝试购买我配置的东西时(“正确”?)play商店弹出窗口出现了,但我的问题出现了。弹出窗口带有这样的消息:“错误身份验证是必需的。您必须使用您的Google帐户登录”。

我遗漏了什么??我在这上面浪费了几个小时,请帮助我。我确定,我是用我的google资料登录的,因为我看到了我的名字。下面这行是我想买的东西

代码语言:javascript
复制
//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)
    );

我打电话来买东西

代码语言:javascript
复制
StoreInventory.BuyItem (IAPGoogle.HEART_PACK.ItemId);
EN

回答 1

Stack Overflow用户

发布于 2015-01-15 07:02:34

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

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27934552

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档