poiuytrez / AndroidInAppBilling

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

How to handle JSON object #98

Open ESA14 opened 8 years ago

ESA14 commented 8 years ago

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.

srthakkar commented 8 years ago

Hey ESA14,

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