Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the possibilities to get this error code 3 in InApp purchase?

I am using InApp V3 code for in-app purchases in my application , i am getting this error BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE and error value :3 when Google account is not available in device. I want to know is there any other possibilities to get this error, because when i get this error i need show a popup to the user with some data. If this is causing because of Google account not available on device i will show the dialog with related text. this is the code i am using

mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {     public void onIabSetupFinished(IabResult result) {                       if (!result.isSuccess()) {                 // error here                            return;         }     } }); 

this is the error Error checking for billing v3 support. (response: 3:Billing Unavailable)

like image 620
RajaReddy PolamReddy Avatar asked Jan 13 '14 12:01

RajaReddy PolamReddy


People also ask

How do I see in-app purchases on Android?

Open the Google Play app and tap on the three-lined menu. Go to Account. Tap on the Purchase History tab, and you'll see all the apps you've purchased on Google Play. All the apps are going to be separated into months.


2 Answers

As we can see directly in the code of the setup of the IabHElper of the sample provided by Google, the error means:

"Billing service unavailable on device."

As you can read here that error means

Billing API version is not supported for the type requested 

This is the In-app Billing Reference (IAB Version 3), so the error means that the IAB v3 is not installed on the device.

Actually this means that the user has a Google account, and probably also an in-app billing service, but it doesn't have the last version. This happens in old devices, and where the user never updates anything. It used to be devices where you can see the old Market app instead of the Play app.

So the error you have to show to the user, and the test that you have to perform is not if the device has a Google account, but if it has the Google Play services installed and properly updated.

If you look for the code in all the library SDK, and the helper classes provided by google, the only place where we can find that exactly in the function that you are calling: the startSetup of the IabHelper class

Intent serviceIntent = new Intent(                 "com.android.vending.billing.InAppBillingService.BIND");         if (!mContext.getPackageManager().queryIntentServices(serviceIntent, 0)                 .isEmpty()) {             // service available to handle that Intent             mContext.bindService(serviceIntent, mServiceConn,                     Context.BIND_AUTO_CREATE);         } else {             // no service available to handle that Intent             mServiceConn=null;             if (listener != null) {                 listener.onIabSetupFinished(new IabResult(                         BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE,                         "Billing service unavailable on device."));             }         } 

This means that the app couldn't connect to the service in the device, since the package manager doesn't even know it. That's the only option that can trigger that error. And what does it mean that it couldn't connect to the service? It means one of these:

  • The device doesn't have the service installed.
  • It has an old version, since we know that the latest versions of play store, uses the IAB v3.

So, your error only can mean one of these, that for you means that you have to show a message to the user like "You don't have Google Play services installed, or you have to update it". And there are no other possibilities for getting that error.

But, if you want to make it easier for the users, you can say the they need to update the Google Play App to the last version. And that will make everything work like a charm.

like image 139
Carlos Robles Avatar answered Sep 21 '22 13:09

Carlos Robles


This error is also received after the user removes their google account from the device.

like image 27
pareshgoel Avatar answered Sep 21 '22 13:09

pareshgoel