Hi. Sorry for my english.
Before doing it, I read an article by GodotGooglePlayBilling
docs.godotengine.org/ru/stable/tutorials/platform/androidinapp_purchases.html
Downloaded and installed plugin
github.com/godotengine/godot-google-play-billing/releases
My app is published in alpha test, I added purchases in Google Play Console.
The code:
if Engine.has_singleton("GodotGooglePlayBilling"):
payment = Engine.get_singleton("GodotGooglePlayBilling")
# These are all signals supported by the API
# You can drop some of these based on your needs
payment.connect("connected", self, "_on_connected") # No params
payment.connect("disconnected", self, "_on_disconnected") # No params
payment.connect("connect_error", self, "_on_connect_error") # Response ID (int), Debug message (string)
payment.connect("purchases_updated", self, "_on_purchases_updated") # Purchases (Dictionary[])
payment.connect("purchase_error", self, "_on_purchase_error") # Response ID (int), Debug message (string)
payment.connect("sku_details_query_completed", self, "_on_sku_details_query_completed") # SKUs (Dictionary[])
payment.connect("sku_details_query_error", self, "_on_sku_details_query_error") # Response ID (int), Debug message (string), Queried SKUs (string[])
payment.connect("purchase_acknowledged", self, "_on_purchase_acknowledged") # Purchase token (string)
payment.connect("purchase_acknowledgement_error", self, "_on_purchase_acknowledgement_error") # Response ID (int), Debug message (string), Purchase token (string)
payment.connect("purchase_consumed", self, "_on_purchase_consumed") # Purchase token (string)
payment.connect("purchase_consumption_error", self, "_on_purchase_consumption_error") # Response ID (int), Debug message (string), Purchase token (string)
#
payment.startConnection()
print("GodotGooglePlayBilling start")
else:
show_alert("Android IAP support is not enabled.")
Working, print "GodotGooglePlayBilling start".
In the application, I call the code:
var query = payment.queryPurchases("inapp") # Use "subs" for subscriptions.
if query.status == OK:
for purchase in query.purchases:
if !purchase.is_acknowledged:
print("Purchase " + str(purchase.sku) + " has not been acknowledged. Acknowledging...")
payment.acknowledgePurchase(purchase.purchase_token)
else:
print("error..")
And the application crashes without error output.
Running "adb logcat" prints out a lot of messages from the found application related:
10-02 11:28:06.999 4706 4865 W InputDispatcher: channel '6cceaa com.zloyalex.bow/com.godot.game.GodotApp (server)' ~ Consumer closed input channel or an error occurred. events=0x9, fd=567
10-02 11:28:06.999 4706 4865 E InputDispatcher: channel '6cceaa com.zloyalex.bow/com.godot.game.GodotApp (server)' ~ Channel is unrecoverably broken and will be disposed!
I ran the code from the android_iap example, but it also doesn't work on the phone
Please tell me what else needs to be done to start GodotGooglePlayBilling.
Thanks