PeterStaev / nativescript-purchase

:moneybag: A NativeScript plugin for making in-app purchases!
Apache License 2.0
83 stars 28 forks source link

purchase.getProducts throws error with Response code 5 on Android when initialized with more than 20 products #78

Closed ajaymaru closed 5 years ago

ajaymaru commented 5 years ago

When the plugin is initialized (purchase.init) with more than 20 products, subsequent call to purchase.getProducts throws error: "Error: Response from service: 5"

If there are 20 or fewer products, then the plugin works as expected and quite nicely.

Not sure if I am missing something. Any pointers will be greatly appreciated.

PeterStaev commented 5 years ago

Hey @ajaymaru , seems on android you cannot pull all the products (in case there are more than 20), but instead you need to pull them in chunks: https://stackoverflow.com/a/21080893/5272836.

Currently the plugin does not do this, so that's why you get that error.

ajaymaru commented 5 years ago

Thanks @PeterStaev for quick response.

ajaymaru commented 5 years ago

@PeterStaev, I have looked through the code and working on the enhancement. Will send you a pull request once I have it tested at my end.

ajaymaru commented 5 years ago

@PeterStaev, sent the PR (#79 ) for your review when you get a chance. Thanks.

PeterStaev commented 5 years ago

Thank you! New version on npm (2.0.13) includes your fix.