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
Contributor
dhatchina
Posts: 11
Registered: ‎11-28-2012
My Device: Blackberry Playbook

Re: Android - Inapp purchase response

[ Edited ]

 

           I am using playbook for testing and my app is in portrait mode. Anybody confirm, this issue still exist or not? I think that might be a problem. 

 

Thanks.

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Android - Inapp purchase response

What OS of PlayBook are you using? The bug you referenced has been fixed since earlier builds of 2.1.0:

https://www.blackberry.com/jira/browse/TABLET-640

 

Did you upload your app to App World for both PlayBook and BlackBerry 10?

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
dhatchina
Posts: 11
Registered: ‎11-28-2012
My Device: Blackberry Playbook

Re: Android - Inapp purchase response

[ Edited ]

Thanks for reply,

 

          I'm using Playbook (OS Version is 2.1.0.1314). As i told earlier, IAP working fine with Android market but nothing happen when click on buy button in playbook version of ported app. I remove signature verfiication code. My inapp purchase code is same as inapp purchase sample application in android developer site and i'm using android inapp billing Version 2. I changed the orientation from portrait to lanscape and i uploaded as draft app to app world, and i downloaded using sandbox test account. But nothing happened. 

  

 When i sending request itseft fails, my request code is

Bundle response = mService.sendBillingRequest(request); // mservice - IMarketBillingService
PendingIntent pendingIntent  = response.getParcelable(Consts.BILLING_RESPONSE_PURCHASE_INTENT);
        if (pendingIntent == null) {
              Log.e(TAG, "Error with requestPurchase");
              return Consts.BILLING_RESPONSE_INVALID_REQUEST_ID;
        }

 

I checked the responsecode, that return value 5 (i.e) developer_error. and pendingIntent object become null. After that i can't proceed the next step. Even When i checked the support for IAP through code, code return false value.

 

Thank in advance.

 

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Android - Inapp purchase response

Can you PM me the ID of your app? I can perform some testing on my side to see if I notice anything strange.

Garett
@garettBeuk
--
Goodbye everybody!
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Android - Inapp purchase response

I have tested this app out (thanks for the details dhatchina) and it seems that the first time the purchase attempt is made I get an error saying that the "Marketplace is unavailable" or something to that effect. All subsequent purchase attempts result in no message at all. I have even tried re-installing the application.

 

Have you tried debugging the app to see where this may be failing?

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
dhatchina
Posts: 11
Registered: ‎11-28-2012
My Device: Blackberry Playbook

Re: Android - Inapp purchase response

[ Edited ]

Hi gbeukeboom,

 

   When you are testing, Is it open up the App world app? For me there is no interation with App world App

 

Bundle request = makeRequestBundle("REQUEST_PURCHASE"); 
request.putString("ITEM_ID", mProductId);
request.putString("ITEM_TYPE", mProductType); // I Didn't add Developer payload to the request

Bundle response = mService.sendBillingRequest(request);

PendingIntent pendingIntent = response.getParcelable("PURCHASE_INTENT");
  if (pendingIntent == null) { // PendingIntent == null, And i'm return -1
       Log.e(TAG, "Error with requestPurchase"); // Atlast It come here. 
       return -1;
  }

 From the above code, Why i'm getting PendingIntent as null. After Getting PendingIntent, I'm start showing BuyPage in android. Is i need to change in the above code?

 

Please provide Some sample code for IAP, then I can modify my code according to that. Because I Currently implemented the same code which is in android Sample IAP app (Version 2). Only I changed the SKU value in my code. Please the check the Android Market Sample Application For IAP version 2.

 

Thanks for your support.

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Android - Inapp purchase response

No, App World does not open but there is interaction with the App World app in the background. As I said in my post the first time I try the app it does provide an error message but all subsequent attempts fail. 

 

Please try debugging your application, once you reply with the results we can determine where to go from there.

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
dhatchina
Posts: 11
Registered: ‎11-28-2012
My Device: Blackberry Playbook

Hi Garett,           As i told earlier, Problem is found...

Hi Garett,

 

        As i told earlier, Problem is found in folowing code,

 

Bundle request = makeRequestBundle("REQUEST_PURCHASE"); 
request.putString("ITEM_ID", mProductId);
request.putString("ITEM_TYPE", mProductType); // I Didn't add Developer payload to the request

Bundle response = mService.sendBillingRequest(request);

PendingIntent pendingIntent = response.getParcelable("PURCHASE_INTENT");
  if (pendingIntent == null) { // PendingIntent == null, And i'm return -1
       Log.e(TAG, "Error with requestPurchase"); // Atlast It come here. 
       return -1;
  }

Can find anything wrong with this code?

 

Thanks 

     

Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Hi Garett, As i told earlier, Problem is found...

I can't see anything wrong myself, but have you tried debugging?

What are you passing for mProductId? Does this exist in the App World Vendor portal? if so, do you have it listed as the content ID or SKU?

Garett
@garettBeuk
--
Goodbye everybody!
New Contributor
shurikv
Posts: 7
Registered: ‎01-29-2013
My Device: Bold

Re: Hi Garett, As i told earlier, Problem is found...

Hello!

 

I have problem with using in-app purchase on playbook.
I use Android In-app billing v3 but this code:

 

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

 

return false.

 

How to solve this problem? Help please.