0 votes

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

in Engine by (20 points)

1 Answer

0 votes

For those who accept the same behavior of the program, the solution is to download the code for 1.0.1, compile and then do the same as in solution 1.0.0.
It is strange that the official link does not immediately contain the ready-made plugin version 1.0.1

by (20 points)

had the same problem, thanks for the solution..

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.