Problem using query response from inApp Billing

17 Views Asked by At

I'm triying to retrieve some data using query ProductDetails of inAppBilling.

The response obtained is like this:

["ProductDetails{jsonString='{"productId":"1","type":"subs","title":"XXX","name":"XXX","description":"XXX","localizedIn":["es-ES"],"skuDetailsToken":"XXX","subscriptionOfferDetails":[{"offerIdToken":"XXX","basePlanId":"XXX","pricingPhases":[{"priceAmountMicros":XXX,"priceCurrencyCode":"EUR","formattedPrice":"1,19 €","billingPeriod":"P1M","recurrenceMode":1}],"offerTags":[]}]}', parsedJson={"productId":"1","type":"subs","title":"XXX","name":"XXX","description":"XXX","localizedIn":["es-ES"],"skuDetailsToken":"XXX","subscriptionOfferDetails":[{"offerIdToken":"XXX","basePlanId":"p1m","pricingPhases":[{"priceAmountMicros":1190000,"priceCurrencyCode":"EUR","formattedPrice":"1,19 €","billingPeriod":"P1M","recurrenceMode":1}],"offerTags":[]}]}, productId='XXX', productType='subs', title='XXX', productDetailsToken='XXX', subscriptionOfferDetails=[com.android.billingclient.api.ProductDetails$SubscriptionOfferDetailsXXX]} (I changed some data with "XXX")

If I delete the ["ProductDetails part I can parse the json and access to the data I need, but I can't parse the json without deleting this part and I can't delete this part from the response.

I'm not coding, I make the app with Kodular.

In other words, if I paste the response (with the ["ProductDetails part deleted) in a text block, I can manage the json propoerly. If I use the response directly, the json can't be parsed and the data managed.

Any idea to fix this? Thanks in advance.

I tried to manage the data using directly the response obtained, but can't do it because there is a part that makes the json invalid and I can't delete it from the response.

0

There are 0 best solutions below