4

I'm currently migrating IAB v2 to v3. In v2, if you owned specific item that you try to buy, Google Play dialog shows "you already own this item" with red text color. In v3, i can get error response 5 (Item Already Owned) but Google Play dialog never show up to screen.

I'm using latest sample code IabHelper and it seems like returning with not starting intent if response is not 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));

Is it possible to behavior same as v2? or should i create dialog saying with "already owned" in my App?

Maulik
  • 3,316
  • 20
  • 31
user2223820
  • 583
  • 1
  • 5
  • 12

1 Answers1

0

Is it possible to behavior same as v2? or should i create dialog saying with "already owned" in my App?

Yes, this issue has been reported and an update IAB v3 repository is available here. The crash you mention is fixed with this repo.

Note:

As reported by Bruno Oliveira.

Community
  • 1
  • 1
amalBit
  • 12,041
  • 6
  • 77
  • 94
  • 1
    i've already put latest code in my App as you mentioned. the crash does not happen but google play store dialog is not showing up. play store will not launched if i already own the item? – user2223820 Jun 22 '13 at 06:23