AndroidInAppBilling icon indicating copy to clipboard operation
AndroidInAppBilling copied to clipboard

How to handle JSON object

Open ESA14 opened this issue 9 years ago • 1 comments

I have a few in-app purchases in my app. How can I check which of this purchases a user owns? I think I must get the productid from the JSON object, but how? I tried: inappbilling.getPurchases(successHandler, fail);

function successHandler (result) { strResult = JSON.parse(result); alert(strResult.productId); }

This doesn't work.

Please help me.

ESA14 avatar May 31 '15 18:05 ESA14

Hey ESA14,

Use JSON.stringify(result) instead of JSON.parse(result).

srthakkar avatar Feb 09 '16 09:02 srthakkar