godotengine / godot-google-play-billing

Godot Android plugin for the Google Play Billing library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

querySkuDetails returns an empty dictionary

Tekuzo opened this issue · comments

Hello

I am having an issue with the querySkuDetails function.

The example code in the documentation says

func _on_connected(): payment.querySkuDetails(["my_iap_item"], "inapp") # "subs" for subscriptions

I assume that the string my_iap_item is supposed to be replaced by the ID of our In App Purchase in the Google Play Developer Console for the app. My In App Purchase is named "1000 Coins" but the ID is "1000_coins" I have tried to put both into this function call

payment.querySkuDetails(["1000_coins"], "inapp");
payment.querySkuDetails(["1000 Coins"], "inapp");

I then copied the _on_sku_details_query_completed(sku_details): function from the documentation and I added print(sku_details) which is outputting an empty dictionary to the console when I run this, both with the ID and the name.

I already have Google Play Game Services working with Snapshots. My Game already has 50 achievements and leader-boards for the 4 levels, so I don't think that it is an authentication problem, my debug build's SHA-1 fingerprint is in the approved clients list.

I am completely confused as to what I am doing wrong.

this line is wrong:

payment.querySkuDetails(["1000 Coins"], "inapp");

use only

payment.querySkuDetails(["1000_coins"], "inapp");

the rest is the same as the way I'm using it and it works.

according to google documentation, you need a published app (could be in internal test mode) for this to work

don't forget to add permission: com.android.vending.BILLING on your export configuration

Thanks.

I have 2 published tracks. I have a closed alpha and an internal test.

Perhaps I didn't add the billing permission. Thank you I will double check that right now.

/edit

I also knew that it was something I was doing wrong, not the plugin.

Do I need to add Billing as a custom permission?

I don't see a billing checkbox in the list of android permissions.

Do I need to add Billing as a custom permission?

I don't see a billing checkbox in the list of android permissions.

You shouldn't need to add the permission manually. The Google Play Billing Library adds it automatically.

Then I am back at square 1, why is payment.querySkuDetails(["1000_coins"], "inapp"); returning an empty dictionary?

lol

Do I need to add Billing as a custom permission?

I don't see a billing checkbox in the list of android permissions.

Yes, I did it manually in custom permissions. But I dont know if this is mandatory or the module will add this nevertheless.

You need to publish the game with this permission for the query to work.

Try to check your log to see if there is something wrong

adb logcat godot:D *:S

Check if your app has no warning/error at the play store console

If all fails, try starting the official tutorial step by step from the beginning:

Tutorial

Good Luck

If all fails, try starting the official tutorial step by step from the beginning:

Tutorial

Good Luck

The tutorial explains how to install the plugin, and I can drag the GDAP and AAR file into res://android/plugins with the best of them. I will try to do some more troubleshooting when I get home.

I added the custom permission com.android.vending.BILLING and the SKU details started returning a populated dictionary when I ran with USB debugging.