godotengine / godot-google-play-billing

Godot Android plugin for the Google Play Billing library
MIT License
138 stars 39 forks source link

SOLVED: subscription_offer_details=null for subscriptions in billing-v5 #57

Open PickleJesus123 opened 8 months ago

PickleJesus123 commented 8 months ago

I am trying to access the "formatted price string" of a subscription using its subscription_offer_details in plugin release 2.0.0-rc.1 and Godot 4.1.2. However, when I retrieve a subscription product using query_product_details(), it seems to be "null"

PickleJesus123 commented 8 months ago

I solved it. In GooglePlayBillingUtils.java, convertProductDetailsToDictionary() was using ArrayList<Dictionary>, which was turning to null when passed to Godot. I upgraded the code so that is converts it to Object[] before dictionary.put(), and now it now I can read all the data from subscription_offer_details. Here are the specific updates to GooglePlayBillingUtils.java:

changes

PickleJesus123 commented 8 months ago

I created a PR for this fix: https://github.com/godotengine/godot-google-play-billing/pull/58

I'll leave this open in the mean time, so that anyone else dealing with this issue will know what to do, until the PR is merged with the main branch

kyadalu1 commented 6 months ago

Try this