Мое приложение имеет встроенные продукты для покупки.До вчерашнего дня потребители могли покупать продукты, но с сегодняшнего утра только я сохраняю BILLING_RESPONSE_RESULT_ERROR.Может кто-нибудь помочь мне исправить
Ниже приведен мой код для потока покупок
Bundle activeSubs = null;
try {
activeSubs = inAppBillingService.getPurchases(3,
currentActivity.getPackageName(),
"subs",
null);
} catch (RemoteException e) {
//Log.e(TAG, "Failed to retrieve current active subscriptions: " + e.getMessage());
}
ArrayList<String> subscribedSkus = null;
if (activeSubs != null) {
subscribedSkus = activeSubs.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
}
Bundle buyIntentBundle;
if (subscribedSkus != null && !subscribedSkus.isEmpty()) {
//Log.d(TAG, "Initiating upgrade purchase");
} else {
//Log.d(TAG, "Initiating new item purchase");
}
buyIntentBundle = inAppBillingService.getBuyIntentToReplaceSkus(5,
currentActivity.getPackageName(),
subscribedSkus,
skuToPurchase,
"subs",
null);
if (buyIntentBundle != null) {
int resultCode = buyIntentBundle.getInt("RESPONSE_CODE");
if (resultCode == 0) {
PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
if (pendingIntent != null) {
//Log.d(TAG, "Launching intent to initiate item purchase");
currentActivity.startIntentSenderForResult(pendingIntent.getIntentSender(),
RC_PURCHASE_PLAY_STORE_ITEM,
new Intent(),
0,
0,
0);
} else {
showToast(getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.app_cms_cancel_subscription_subscription_not_valid_message)),
Toast.LENGTH_LONG);
}
} else {
if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_USER_CANCELED) {
showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_user_canceled)), false, null, null);
} else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE) {
showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_service_unavailable)), false, null, null);
} else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE) {
addGoogleAccountToDevice();
} else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ITEM_UNAVAILABLE) {
showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_item_unavailable)), false, null, null);
} else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_DEVELOPER_ERROR) {
showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_developer_error)), false, null, null);
} else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ERROR) {
showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_error)), false, null, null);
} else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED) {
showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_item_already_purchased)), false, null, null);
} else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED) {
showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_item_not_owned)), false, null, null);
}
}
}