Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signals not firing properly #47

Open
Chrompower opened this issue May 22, 2023 · 5 comments
Open

Signals not firing properly #47

Chrompower opened this issue May 22, 2023 · 5 comments

Comments

@Chrompower
Copy link

Hello

when using:

func _ready():
	if Engine.has_singleton("GodotGooglePlayBilling"):
		payment = Engine.get_singleton("GodotGooglePlayBilling")
		payment.connect("connected", self, "_on_connected") # No params
		payment.startConnection()

func _on_connected():
	print("Connected with Google Play")

The connected signal gets fired if there is no active internet connection. The print command always gets executed.
I do not trigger the _on_connected() func anywhere manually. I thought that this signal is supposed to be used to check if there is a connection established to the Google servers. According to the Godot Docs you can also check the status with payment.isReady(), but it always returns true. On the other hand, the disconnected signal ("_on_disconnected") never gets fired.

Am I doing something wrong, or missunderstanding something?

I would appreciate any help!

@NianoTT
Copy link

NianoTT commented May 22, 2023

I thought that this signal is supposed to be used to check if there is a connection established to the Google servers.

It checks for the connection to Play Services (in this case Play Store) which runs locally - so yes, this does not require internet connection at all.

Things like IAP information is also cached locally so querySkuDetails and such will work. The purchase itself will fail however, the user will be notified within the Google Overlay - after the purchase process started - that they need an internet connection.

@Chrompower
Copy link
Author

Chrompower commented May 22, 2023

Thank you very much Niano. I didn't know that.

I have an additional question:
Do you have any idea why the sku_details_query_completed signal never gets fired?

I have connected the signals with:

payment.connect("sku_details_query_completed", self, "_on_sku_details_query_completed")

I am starting an SKU-detail-query with:

func _on_connected():
	payment.querySkuDetails(["testsku6"], "inapp") 
	print ("Query SKU details")

The print command gets executed. Then I have this function:

func _on_sku_details_query_completed(sku_details):
	for available_sku in sku_details:
		print("available sku = ", available_sku)
	print ("SKU Query successful")

Here, nothing gets printed / executed. I have also added the _on_sku_details_query_error signals, but they also don't fire.
I thought that the _on_sku_details_query_completed signal should get fired after the query was successful. Am I (again) misunderstanding something?

Thanks in advance!

@NianoTT
Copy link

NianoTT commented May 23, 2023

If you are using 2.0-rc1 (which I guess you are or you would not be able to upload it since 1.x isn't accepted by google), the signals have been renamed - now its "product_details_query_completed" and "product_details_query_error"

There are a few more changes in the return dictionaries, you can look at the source of #36 for more details.
Sadly the docs are not updated as currently nobody maintains this repo.

@Chrompower
Copy link
Author

Thanks again Niano.

Really unfortunate that nobody maintains this repo. I think IAP are very important if you want to earn money with your (mobile) games. I have only basic programming skills – so I cannot help with it (yet) :-(

@kyadalu1
Copy link

kyadalu1 commented Jan 6, 2024

Try this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants