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

Equivalent to _on_billing_resume()? #9

Open
djrain opened this issue Aug 11, 2024 · 2 comments
Open

Equivalent to _on_billing_resume()? #9

djrain opened this issue Aug 11, 2024 · 2 comments

Comments

@djrain
Copy link

djrain commented Aug 11, 2024

Hey, thanks for the updated plugin! The only issue is that I don't see an equivalent function to _on_billing_resume() as in the official repo:
Screenshot 2024-08-11 at 12 58 08 PM

Or perhaps this is handled automatically?

@code-with-max
Copy link
Owner

@djrain https://developer.android.com/google/play/billing/integrate#ooap
Now that the purchase update functions work like coroutines, you don't need to call them separately. They work all the time. To check the current status of purchases, it is enough to call the function:

queryPurchases(productType: String)
productType: "inapp" for products or "subs" for subscriptions.
Handling purchases made [outside your app](https://developer.android.com/google/play/billing/integrate#ooap).

If the application was launched, restarted, or at any other time, just call it and all current purchases will be received in the query_purchases callback.

@djrain
Copy link
Author

djrain commented Aug 11, 2024

I see what you're saying, I think, it's just that the linked docs still instruct to call queryPurchases() in onResume() to catch updates that happened while in the background, and currently it's not clear how to handle this in Godot. I suppose one could detect returning to the foreground with NOTIFICATION_APPLICATION_FOCUS_IN, but this notification was only added in Godot 4.3, and even then I'm not confident if that's quite the same thing as onResume(). Even if just for parity between our code and the official docs, I think it would be nice to have this signal like the official repo does, if possible

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

2 participants