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

Plugin Modernization #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

atlasapplications
Copy link

This plugin was initially built with version 3 as the targeted API version. Adjustments were made to get it to work as a version 5 plugin but significant amounts of deprecated methods and workflows were being used. My game needs a functional billing library that's up-to-date, so I built this plugin from the ground up. Google's current API is now version 7.0.0, which is the new target. The Google Play Billing Library has changed quite a bit since the plugin was first created so here are some of the top changes.

There are now three primary methods for starting a purchase that depend on the purchase type.

  1. If it's a non-consumable purchase, (like a level that you unlock or removing ads) use the purchaseNonConsumable method. This only requires a single product ID.
  2. If it's consumable, (like buying virtual currency or a potion) then use purchaseConsumable. A top reason why these should be separated is because this version of the API now supports the ability to purchase consumable items with varying quantities. So this requires an array of product IDs, but of course can also accept just one.
  3. The last one which needed the most refactoring are subscriptions. Use purchaseSubscription which requires not only a productId but also a planId which is the tier of subscription that the user is choosing.

Additional functionality like setting the personalized price flag is now supported.

This plugin modernization also absorbs my other work with adapting the plugin as a version 2 Godot Android Plugin. I've included an updated .gdap file for backwards compatibility purposes but the new way of consuming Android plugins is with an editor addon which I've also built and included.

Of course there are a lot more changes but these are the top differences. Acknowledging purchases and querying for product details is about the same workflow those just needed revisions on what methods need to be called.

This is a work in progress. My initial testing seems to show that things are working properly but I would not treat this as production-level yet because I'm not an expert with Android development. So, I'd be happy to receive feedback.

I'm a C# user, so the next thing I plan on contributing are the bindings to convert the Godot dictionaries to their corresponding Google Play Billing class.

Updates the plugin to support the new plugin architecture introduced in Godot 4.2. Includes the editor plugin functionality that properly utilizes `EditorExportPlugin.`
This plugin was initially built with version 3 as the targeted API version. Adjustments were made to get it to work as a version 5 plugin but significant amounts of deprecated methods and workflows were being used. My game needs a functional billing library that's up-to-date so I built this plugin from the ground up. The Google Play Billing Library has changed quite a bit since the plugin was first created so here are some of the top changes.

There are now three primary methods for starting a purchase that depend on the purchase type.

1. If it's a non-consumable purchase, (like a level that you unlock or removing ads) use the `purchaseNonConsumable` method.
2. If it's consumable, (like buying virtual currency or a potion) then use `purchaseConsumable.` A top reason why these should be separated is because this version of the API now supports the ability to purchase consumable items with varying quantities.
3. The last one which needed the most refactoring are subscriptions. Use `purchaseSubscription` which requires not only a `productId` but also a `planId` which is the tier of subscription that the user is choosing.

Of course there are a lot more changes but these are the top differences. Acknowledging purchases and querying for product details is about the same workflow those just needed revisions on what methods need to be called.
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

Successfully merging this pull request may close these issues.

1 participant