godot-google-play-billing icon indicating copy to clipboard operation
godot-google-play-billing copied to clipboard

SOLVED: subscription_offer_details=null for subscriptions in billing-v5

Open PickleJesus123 opened this issue 1 year ago • 3 comments

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 avatar Oct 28 '23 20:10 PickleJesus123

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 avatar Oct 31 '23 20:10 PickleJesus123

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

PickleJesus123 avatar Oct 31 '23 20:10 PickleJesus123

Try this

kyadalu1 avatar Jan 06 '24 09:01 kyadalu1