Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
New Contributor
Posts: 7
Registered: ‎01-29-2013
My Device: Bold
My Carrier: MTS

In-app purchase problem

Hello!

 

I have problem with using Android in-app purchase on playbook.
I use Android In-app billing v3 and code for bindService:

 

mContext.bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), mServiceConn, Context.BIND_AUTO_CREATE)

return false.

 

Permission for BILLING granted on AndoidManifest file. In-app purchase integrate using example from android sdk with helpers: /your/sdk/location/extras/google/play_billing/in-app-billing-v03.

 

How to solve this problem? Help please.

New Member
Posts: 1
Registered: ‎01-29-2013
My Device: bb10
My Carrier: Telfort

Re: In-app purchase problem

Hi, just a small note that i am also suffering from this problem. It;'s about the last thing that keeps me from submitting my app to the BB World. This Stackoverflow posting did not help either. I'll update here if I find something.

Developer
Posts: 122
Registered: ‎07-26-2008
My Device: 8320, 9500, 9700
My Carrier: Vodafone

Re: In-app purchase problem

I have the same issue on a PlayBook running 2.1.0.1314, unable to bind to the billing service,  is version 3 billing supported?

New Contributor
Posts: 7
Registered: ‎01-29-2013
My Device: Bold
My Carrier: MTS

Re: In-app purchase problem

Hi!

I solve this problem. Playbook not supported version 3 billing. You must use version 2 billing. You can get source code from Google example.

Some tips:

1. Correct makeRequestBundle method

protected Bundle makeRequestBundle(String method) {
            Bundle request = new Bundle();
            request.putString(Consts.BILLING_REQUEST_METHOD, method);
            request.putInt(Consts.BILLING_REQUEST_API_VERSION, 1);
            request.putString(Consts.BILLING_REQUEST_PACKAGE_NAME, getPackageName());
            return request;
        }

 

2. You must manual register BroadcastReceiver with next code:

 

private void registerBillingReceiver() {
        IntentFilter filter = new IntentFilter();
        filter.addAction("com.android.vending.billing.IN_APP_NOTIFY");
        filter.addAction("com.android.vending.billing.RESPONSE_CODE");
        filter.addAction("com.android.vending.billing.PURCHASE_STATE_CHANGED");
        receiver = new BillingReceiver();
        registerReceiver(receiver, filter);
    }

 in onServiceConnected() method.

Best regards!

Developer
Posts: 122
Registered: ‎07-26-2008
My Device: 8320, 9500, 9700
My Carrier: Vodafone

Re: In-app purchase problem

Thanks for that!  

 

I have version 2 roughly working, just need to work through live testing issues (at my end I'm sure).

 

Cheers,

Bruce

 

New Contributor
Posts: 9
Registered: ‎03-11-2013
My Device: Blackberry Z10
My Carrier: Viettel

Re: In-app purchase problem

Hi shuriky,

 

I've met the same problem as you.

But after fixing the code like you said the In app is still not working.

We got RESULT_ERROR(6) when do LIVE testing with sandbox account.

The app was test by both case: upload on Blackberry world(draft) or install directly in device via cable and result still the same.

 

Do you know what is the issue here?

 

Thanks