В настоящее время я переношу IAB v2 в v3. В v2, если у вас есть определенный предмет, который вы пытаетесь купить, в диалоговом окне Google Play отображается «у вас уже есть этот элемент» с красным цветом текста. В v3 я могу получить ответ об ошибке 5 (элемент уже принадлежит), но диалог Google Play никогда не отображается на экране.Android InApp Billing v3, диалоговое окно google play не отображается
Я использую последний пример код IabHelper и, похоже, возвращается с начинающимся не умыслом, если ответ не является 0.
logDebug("Constructing buy intent for " + sku + ", item type: " + itemType);
Bundle buyIntentBundle = mService.getBuyIntent(3, mContext.getPackageName(), sku, itemType, extraData);
int response = getResponseCodeFromBundle(buyIntentBundle);
if (response != BILLING_RESPONSE_RESULT_OK) {
logError("Unable to buy item, Error response: " + getResponseDesc(response));
flagEndAsync();
result = new IabResult(response, "Unable to buy item");
if (listener != null)
listener.onIabPurchaseFinished(result, null);
return;
}
PendingIntent pendingIntent = buyIntentBundle.getParcelable(RESPONSE_BUY_INTENT);
logDebug("Launching buy intent for " + sku + ". Request code: " + requestCode);
mRequestCode = requestCode;
mPurchaseListener = listener;
mPurchasingItemType = itemType;
act.startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
Можно ли поведение так же, как v2? или мне нужно создать диалог с «уже принадлежащим» в моем приложении?
Я уже установил последний код в своем приложении, как вы упомянули. авария не происходит, но диалоговое окно Google Play Play не отображается. Play Store не будет запущен, если у меня уже есть элемент? – user2223820