我已经按照 android 在应用程序购买中的步骤几乎一直到了 t。
我已经导出了我签名的应用程序,
我提出了 ITEM_ID 的请求包 - “剑”
我上传了 apk 并使用项目 ID“sword”创建了应用内购买条目,然后将我签名的 apk 安装到我的第二部手机上——该手机已分配给我的谷歌测试帐户。
我得到的只是RESULT_DEVELOPER_ERROR,根据:
http://developer.android.com/guide/google/play/billing/billing_reference.html
说我犯了以下错误之一:
1/manifest 错误 - 我的清单明确要求计费 2/应用程序未正确签名 - 我正在安装已签名的 apk,我上传到 android 开发者控制台 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 = "剑"
....我已经在这个问题上用尽了所有的努力——并且很想将机器人完全倾倒在应用计费中,除非某些英雄可能会捕捉到这里出了什么问题。
所有用于测试的标准产品 ID,如 android.test.purchase 等都可以完美运行。