4

現在、IAB v2 を v3 に移行しています。v2 では、購入しようとしている特定のアイテムを所有している場合、Google Play ダイアログに「このアイテムを既に所有しています」と赤いテキスト色で表示されます。v3 では、エラー レスポンス 5 (Item Already Owned) を取得できますが、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と同じ動作は可能ですか?または、アプリで「既に所有している」というダイアログを作成する必要がありますか?

4

1 に答える 1

0

v2と同じ動作は可能ですか?または、アプリで「既に所有している」というダイアログを作成する必要がありますか?

はい、この問題は報告されており、更新された IAB v3 リポジトリはこちらから入手できます。 あなたが言及したクラッシュは、このレポで修正されています。

ノート:

ブルーノ・オリベイラの報告による。

于 2013-06-22T06:10:40.110 に答える