不能够建立在Android在应用内结算的连接 [英] Not being able to establish connection for In app billing in android

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

问题描述

我想在我的应用程序集成在应用程序内结算V3。我调用下面的函数初始化。

I am trying to integrate In app billing v3 in my app. I call the following function to initialize.

public static void SetupInappBilling()
{
    mHelper = new IabHelper(context, base64EncodedPublicKey);
    mHelper.enableDebugLogging(true);
    mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() 
    {
        public void onIabSetupFinished(IabResult result) 
        {
            if (result.isSuccess())
            {
                Log.e("tag", "connected");
                ConnectionEstablished = true;

            } 
            else
            {
                    Log.e("tag", "not connected");

                    ConnectionEstablished = false;
                }
            }
        });
    }

但我不得到再打 OnIabSetupFinishedListener 谁能告诉我怎么解决这个问题

but i dont get call back in OnIabSetupFinishedListener Can anyone tell me how to fix this issue

推荐答案

随着讨论的,例如 IabHelper 实施忽略的返回值 bindService ()电话。

As discussed, the example IabHelper implementation ignores the return value of the bindService() call.

bindService()返回如果不能绑定到服务。在这种情况下,没有回调将永远被调用。在这方面, bindService()的返回值是程序逻辑必不可少的,不应该被忽略;示例应用程序不完全是完美的位置。

bindService() returns false if it cannot bind to the Service. In this case, no callbacks will ever get called. In this respect, the return value of bindService() is essential for the program logic and should never be ignored; the example application is not exactly perfect here.

如果我记得这个正确的,条件下结合的IAB V3将无法正常工作有:

If I recall this correctly, conditions where binding to the IAB V3 will not work are:

  • 只有IAB V2是可用的(它使用了不同的类名)
  • 在谷歌Play是没有完全建立

这篇关于不能够建立在Android在应用内结算的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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