In app purchases with Godotgoogleplaybilling?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By psear

Recently they’ve dropped the old system for the new plugin, and the docs page information is very limited, and the demo project leads to a 404 error. I was hoping someone could explain a few things to me, or point me to some resources, I’ve read this, but it really doesn’t go into much detail about how it works, additionally, the excerpts throw syntax errors, because they reference variables that are not declared. Are these in the singleton? It doesn’t seem to be an ordinary gd script, so I’m not sure how to add the singleton and access the variables that the doc recommends.

So, can someone explain:

  1. At what point do you query an SKU, and when do you acknowledge the purchase?
  2. Does the singleton throw a signal when the item is paid for in the play store?
  3. The docs list a “full example”, here:
func _on_connected():
   payment.querySkuDetails(["my_iap_item"], "inapp") # "subs" for subscriptions

func _on_sku_details_query_completed(sku_details):
    for available_sku in sku_details:

Where are available_sku and sku_details declared?
4. The docs say queryPurchases will return a dictionary with all the purchases and an error code. Where are these error codes, to help us interpret whatever issues might arise?

Did you find an answer tot his?

hamza_memon | 2020-11-20 08:24