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

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

问题描述

我想在应用内购买来实现,并有好几天的问题。当用户试图进行购买它是成功的,但应用程序是给一个奇怪的错误OS构建蜂窝其中prevents用户接收购买,直到他们再次点击购买按钮,显然可以追溯到。

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.

步骤:

请购买

购买成功

没有给出耗材

再次点击购买按钮

耗材给

下面是当没有给出耗材我收到错误:

日志标签:Finsky

Log Tag: Finsky

日志信息[1] 1.run:com.mybillingproblem:为应用程式内缺少交付数据one_chip

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

PID / TID:26927

PID/TID: 26927

code:

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的罐子。我不认为这是问题,但因为它已经建议,似乎是一种常用的包装。

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.

谢谢!

推荐答案

请问你活动的的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天全站免登陆