Android 应用内计费服务在某些设备上不可用
我正在应用程序中使用应用内付费购买。下面是我使用makerequestbundle的代码Android 应用内计费服务在某些设备上不可用,android,in-app-billing,Android,In App Billing,我正在应用程序中使用应用内付费购买。下面是我使用makerequestbundle的代码 protected Bundle makeRequestBundle(String method) { Bundle request = new Bundle(); request.putString(BILLING_REQUEST, method); request.putInt(API_VERSION, 1); request.putString(PACKAGE_NAME, getPackageName
protected Bundle makeRequestBundle(String method) {
Bundle request = new Bundle();
request.putString(BILLING_REQUEST, method);
request.putInt(API_VERSION, 1);
request.putString(PACKAGE_NAME, getPackageName());
return request;
}
下面是我用于购买请求的代码
Bundle response = mService.sendBillingRequest(request);
Integer responseCodeIndex = (Integer) response.get("RESPONSE_CODE");
PendingIntent pendingIntent = (PendingIntent)
response.get("PURCHASE_INTENT");
PendingIntent pendingIntent1 = (PendingIntent) response.get("BUY_INTENT");
Long requestIndentifier = (Long) response.get("REQUEST_ID");
BillingConstants.ResponseCode responseCode =
BillingConstants.ResponseCode.valueOf(responseCodeIndex);
Log.i(TAG, "REQUEST_PURCHASE Sync Response code: "+responseCode.toString());
此代码给出错误,Android 5.0上不提供此服务