使用Android测试帐户有延迟吗?

时间:2012-07-10 19:37:53

标签: android in-app-purchase android-service in-app-billing

我已经按照Android应用程序中的步骤购买了很多东西。

我已导出已签名的应用

我发出了ITEM_ID请求包 - “剑”

我上传apk并使用商品ID“sword”创建应用内购买条目,然后我将已签名的apk安装到我的第二部手机上 - 这是分配给我的Google测试帐户。

我得到的是RESULT_DEVELOPER_ERROR,根据:

http://developer.android.com/guide/google/play/billing/billing_reference.html

说我犯了以下错误之一:

1 /清单错误 - 我的清单明确要求开票 2 /应用程序没有正确签名 - 我正在安装我上传到android开发者控制台的签名apk 3 /缺少捆绑密钥或无法识别的请求类型 - 我的捆绑包如下所示:

request.putString("BILLING_REQUEST", method);
request.putInt("API_VERSION", 1);
Log.e("sc2","package name is :"+mContext.getPackageName());

request.putString("PACKAGE_NAME", mContext.getPackageName());

接下来是:

   request.putString("ITEM_ID", itemId);
        try {
            Bundle response = mService.sendBillingRequest(request);

            //The RESPONSE_CODE key provides you with the status of the request
            Integer responseCodeIndex   = (Integer) response.get("RESPONSE_CODE");
            //The PURCHASE_INTENT key provides you with a PendingIntent, which you can use to launch the checkout UI
            PendingIntent pendingIntent = (PendingIntent) response.get("PURCHASE_INTENT");
            //The REQUEST_ID key provides you with a unique request identifier for the request
            Long requestIndentifier     = (Long) response.get("REQUEST_ID");
            Log.i(TAG, "current request is:" + requestIndentifier);
            C.ResponseCode responseCode = C.ResponseCode.valueOf(responseCodeIndex);
            Log.i(TAG, "REQUEST_PURCHASE Sync Response code: "+responseCode.toString());

            startBuyPageActivity(pendingIntent, new Intent(), activityContext);

其中itemId =“剑”

....我已经筋疲力尽地解决了这个问题 - 并且我很想在app app中抛弃机器人,但是一些英雄可能无法捕捉到这里出了什么问题。

所有用于测试的标准产品ID(如android.test.purchase等)都能正常运行。

1 个答案:

答案 0 :(得分:0)

最后答案是肯定的。这只是我添加谷歌测试帐户之间的延迟,实际上它被识别为:@!谷歌应该对此提出警告 - 应用内结算是代码的完全噩梦!