poiuytrez / AndroidInAppBilling

Android App Billing plugin for Cordova
174 stars 144 forks source link

getProductDetails not returning the product details #34

Closed severedsea closed 10 years ago

severedsea commented 10 years ago

The success callback in getProductDetails v3 doesn't return the product details in the Inventory object. I noticed that the QueryInventoryFinishedListener that is used in getProductDetails just sends success ("OK") as callback and not the details itself. I'm using this API to show the price and description before user proceeds on purchasing the IAB product.

nprather commented 10 years ago

I'm having this same problem... It appears to be returning items that I've previously purchased but I just want to get and display the price before purchasing....

severedsea commented 10 years ago

Hi @nprather ! The reason I closed this issue is because apparently I was using a forked or old version. Basically, not the one in this repo. After updating, the issue was fixed.

Just to guide you on where to look at, in InAppBillingPlugin.java, line 262 getProductDetails will invoke an asynchronous call to retrieve the details of the SKUs you provided. The callback function is in line 305 mGotDetailsListener. You can see that the plugin converts the products to JSON and returns it. Hope this helps you debug the issue.

nprather commented 10 years ago

Hi @severedsea ! Yeah, I downloaded the latest code via the Download ZIP option on this page: https://github.com/poiuytrez/AndroidInAppBilling and the java code is correct but it still only returns items I've previously purchased with my test account... I just tested this again to make sure...

Here's the code, I even just tried to call get all available items, but the same thing happens...

image

Thanks for your help!

severedsea commented 10 years ago

Strange. Just would like to confim, how do you call this method through the Javascript?

inappbilling.getProductDetails(success, fail, ['com.foo.bar.product1', 'com.foo.bar.product2']);

And I noticed your getProductDetails is on line 270, and the one in the repo is 261. I'm assuming you added some sysouts? Just checking.

nprather commented 10 years ago

Yeah that's how I call it in javascript. Okay, yeah I added some comments at the top of the InAppBillingPlugin.java file for the different public keys that I use with my apps but that's all...

Any case I've just entered a short term work around where I pull in the price from a separate web service but I'll come back to this later when I get time, right now I have to move on...

Thanks for your help though! Nathan

poiuytrez commented 10 years ago

@severedsea Thank you for providing the technical support.