Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InAppBilling V3 - "purchaseData" and "dataSignature" are null when purchasing subscription item

I have a problem purchasing subsciption items with the new InAppBilling V3

Here's my IABHelper's handleActivityResult method:

    public boolean handleActivityResult(int requestCode, int resultCode, Intent data) {
            IabResult result;
            if (requestCode != mRequestCode)
                return false;

            checkSetupDone("handleActivityResult");

            // end of async purchase operation
            flagEndAsync();

            if (data == null) {
                Log.e(TAG + "Null data in IAB activity result.");
                result = new IabResult(IABHELPER_BAD_RESPONSE, "Null data in IAB result");
                if (mPurchaseListener != null)
                    mPurchaseListener.onIabPurchaseFinished(result, null);
                return true;
            }

            int responseCode = getResponseCodeFromIntent(data);
            String purchaseData = data.getStringExtra(RESPONSE_INAPP_PURCHASE_DATA);
            String dataSignature = data.getStringExtra(RESPONSE_INAPP_SIGNATURE);\
            ...

purchaseData and dataSignature are null after that code, and as a result, the purchase flow can't be completed.

When Im trying to purchase in-app items, all works well. purchaseData and dataSignature aren't null.

This guy seem to had the same problem:
Google Play In-App Purchase returns error code -1008: null puchaseData or dataSignature

but it doesn't work for me, Im still getting null for the both fields.

What am I doing wrong? thanks in advance!

like image 369
dor506 Avatar asked Jun 23 '13 11:06

dor506


1 Answers

I only solved this problem, testing in REAL case. I published the app and sign with one test account, and get valid responses.

like image 96
Felipe FMMobile Avatar answered Nov 07 '22 02:11

Felipe FMMobile