in-app billing android return authentication is required when try to subscribe to product

Amira Elsayed Ismail picture Amira Elsayed Ismail · Jan 13, 2015 · Viewed 21.1k times · Source

This is my first time to deal with In-App Billing in android 1) I am using API v3 2) I have upload alpha version of my app to be able to test then

enter image description here

3) I have created a subscribe product

enter image description here

4) This is my code to subscribe in the product

mSubscribeButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {

            try {

                Bundle subscribeIntentBundle = mService.getBuyIntent(3, getPackageName(), "my_product_id", "subs", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                PendingIntent pendingIntent = subscribeIntentBundle.getParcelable("BUY_INTENT");

                if (subscribeIntentBundle.getInt("RESPONSE_CODE") == 0) {

                    startIntentSenderForResult(pendingIntent.getIntentSender(), 4002, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
                } else {
                    Toast.makeText(MainActivity.this, "Error Code: " + subscribeIntentBundle.getInt("RESPONSE_CODE"), Toast.LENGTH_SHORT).show();
                }
            } catch (RemoteException e) {
                e.printStackTrace();
            } catch (SendIntentException e) {
                e.printStackTrace();
            }
        }
    });

5) I am getting the following error

enter image description here

  • I have tried to use different devices and all have the same error, I am also logged in with my Google account and can open Google Play Store and view my apps

  • I have tried also to clear data of Google Play Store from app manager

Can anyone help please ??

Answer

mmw5610 picture mmw5610 · Jan 22, 2015

I have the same issue previously. Go to your google developer console and make sure your app is PUBLISHED to any version(alpha, beta or prod). Then, the In app purchase will work :)