Android in-app purchases

    If you learn better by looking at an example, you can find the demo project .

    The new GodotGooglePlayBilling API is not compatible with its predecessor GodotPaymentsV3.

    • You need to enable the Custom Build option in your Android export settings and install the GodotGooglePlayBilling plugin manually (see below for details)
    • All purchases have to be acknowledged by your app. This is a requirement from Google. Purchases that are not acknowledged by your app will be refunded.
    • Support for subscriptions
    • Signals (no polling or callback objects)

    Usage

    Getting started

    If not already done, make sure you have enabled and successfully set up . Grab the``GodotGooglePlayBilling`` plugin binary and config from the releases page and put both into res://android/plugins. The plugin should now show up in the Android export settings, where you can enable it.

    All API methods only work if the API is connected. You can use to check the connection status.

    Querying available items

    As soon as the API is connected, you can query SKUs using querySkuDetails.

    Full example:

    Check if the user purchased an item

    To get all purchases, call queryPurchases. Unlike most of the other functions, queryPurchases is a synchronous operation and returns a with a status code and either an array of purchases or an error message.

    Full example:

    If your in-app item is not a one-time purchase but a consumable item (e.g. coins) which can be purchased multiple times, you can consume an item by calling consumePurchase with a purchase token. Call to get the purchase token. Calling consumePurchase automatically acknowledges a purchase.

    Subscriptions