Android In-App Billing v3: not receiving signatures

I am working on the In App Store in my application, I used AndroidBillingLibrary from robotmedia when I buy android.test.purchased using the library, the answer is ok, all the data I need is there.

The problem is that when I switched to Android In-App Billing v3 , it all came from the answer, without signatures.

{"packageName":"com.my.sampleapp","orderId":"transactionId.android.test.purchased","productId":"android.test.purchased","developerPayload":"","purchaseTime":0,"purchaseState":0,"purchaseToken":"inapp:com.my.sampleapp:android.test.purchased"}

I followed exactly this sample https://developer.android.com/training/in-app-billing/preparing-iab-app.html#GetSample , but there is no signature. I even run this sample Google app, but no luck.

I correctly set the Base64-encoded RSA public key mHelper = new IabHelper(this, myPublicKey);

and this is my purchase code mHelper.launchPurchaseFlow(this, itempackage, 10001, mPurchaseFinishedListener);

 OnIabPurchaseFinishedListener mPurchaseFinishedListener = new OnIabPurchaseFinishedListener() { public void onIabPurchaseFinished(IabResult result, Purchase purchase) { Log.i("Billing", "purchasing: " + result.getMessage()); if (result.isFailure()) { Log.i("Billing", "Error purchasing: " + result); return; } else if (purchase.getSku().equals("android.test.purchased")) { Log.i("Billing - signature", purchase.getSignature()); consumeItems(); } else { Log.i("Billing", "Error purchasing: " + result); } } }; 

Somehow my mPurchaseFinishedListener does not receive anything after the purchase, but protected void onActivityResult(int requestCode, int resultCode, Intent data) receives something, but there is no signature there.

Any solutions? It is strange that v2 receives signatures, but v3 does not.

+12
android in-app-purchase
Jan 11 '13 at 5:03
source share
3 answers

You do not get signatures for test identifiers, android.test.purchased, etc.

You will receive signatures with real purchases.

+12
Feb 07 '13 at 13:05
source share

As Rawkode said, you no longer receive signatures for test purchases (android.test. *). I took the dive and uploaded my application to the market (I just did not publish it) using my real products.

Signatures with low and contemplation began to return! I recommend changing any server-side validation you use to skip signature verification when the data contains the android.test identifier. *. Id.

+1
Feb 23 '13 at 16:46
source share

What do you mean signatures? Is this a subscription? Or an element in the application (consumed or not)? Since in-App Billing v3 does not currently support subscriptions, if you want this feature, you need to use v2 (https://developer.android.com/google/play/billing/billing_overview.html). Also, make sure your product is marked as a “managed item” on the developer's console (for Billing v3).

Sorry if I misunderstood. Also, try turning on debug mode in your IabHelper instance, this will provide you with a better overview of your problem.

 mHelper.enableDebugLogging(true, "YOURTAG"); 

I suggest taking a look at the implementation guide on the developers website: https://developer.android.com/google/play/billing/billing_integrate.html

There is also sample code.

0
Jan 11 '13 at 5:52
source share



All Articles