应用内结算问题 [英] In app billing issue

查看:22
本文介绍了应用内结算问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在应用购买中实施,但几天来一直遇到问题.当用户尝试购买时,它是成功的,但应用程序给出了一个奇怪的错误,显然可以追溯到 os build honeycomb 阻止用户收到购买,直到他们再次点击购买按钮.

I am trying to implement in app purchasing and have had problems for days. When a user attempts to make a purchase it is successful but the app is giving an odd error that apparently dates back to os build honeycomb which prevents users from receiving the purchase until they click the buy button again.

步骤:

购买

购买成功

不提供消耗品

再次点击购买按钮

消耗品给定

这是我在未提供消耗品时遇到的错误:

日志标签:芬斯基

日志消息 [1] 1.run:缺少 inapp:com.mybillingproblem:one_chip 的交付数据

Log Message [1] 1.run: missing delivery data for inapp:com.mybillingproblem:one_chip

PID/TID:26927

PID/TID: 26927

代码:

public void oneChip(String noVal) {
    Log.v("oneChip", "Calling launch purchase flow");
    bp.purchase(this, itemOne);
    Log.v("oneChip", "made it through launch purchase flow");
}

    bp = new BillingProcessor(this, base64EncodedPublicKey,
            new BillingProcessor.IBillingHandler() {

                @Override
                public void onBillingInitialized() {
                    Log.v("chip", "billing initialized");
                    readyToPurchase = true;
                }

                @Override
                public void onProductPurchased(String productId,
                        TransactionDetails details) {
                    Log.v("chip", productId + " purchased");
                    if (bp.consumePurchase(productId)) {
                        if (productId == "itemOne"
                                || productId == "one_chip")
                            ChipUpdate.updateChipCount(2500);
                    }
                }

                @Override
                public void onBillingError(int errorCode, Throwable error) {
                    Log.v("chip", "Error code: " + errorCode);
                    Log.v("chip", "Error: " + error);
                }

                @Override
                public void onPurchaseHistoryRestored() {
                    for (String sku : bp.listOwnedProducts())
                        Log.v("chip", "Owned Managed Product: " + sku);
                    for (String sku : bp.listOwnedSubscriptions())
                        Log.v("chip", "Owned Subscription: " + sku);
                }

            });

注意:我使用的是应用内计费 v3 jar.我不认为这是问题所在,因为它已被推荐并且似乎是常用的包装器.

Note: I am using the in app billing v3 jar. I don't think this is the issue though as it has come recommended and seems to be a commonly used wrapper.

谢谢!

推荐答案

你的Activity的onActivityResult()是什么样子的?你是否有一个?通常你将结果传递给 IabHelper 的 handleActivityResult

How does your Activity's onActivityResult() look like? Do you have one? Usually you pass the the result to to IabHelper's handleActivityResult

像这样:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
    // Pass on the activity result to the iab helper for handling
    if (!mHelper.handleActivityResult(requestCode, resultCode, data))
    {
      // not handled, so handle it ourselves (here's where you'd
      // perform any handling of activity results not related to in-app
      // billing...
      super.onActivityResult(requestCode, resultCode, data);
    }
}

这篇关于应用内结算问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆