Google IAP

Type Library
Revision 2016.2934
Keywords Google, IAP, in-app purchases
Platforms Android

Overview

The Google IAP plugin allows you to support in-app purchasing on Android, including in-game currency, upgrades, and more.

For in-app purchasing on other platforms, see the documentation for Apple IAP or Amazon IAP.

Notes

Syntax

local store = require( "plugin.google.iap.v3" )

Properties

Functions

Events

Project Settings

To use this plugin, add an entry into the plugins table of build.settings. When added, the build server will integrate the plugin during the build phase.

settings =
{
    plugins =
    {
        ["plugin.google.iap.v3"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { android=true }
        },
    },
}

In addition, you must enable the BILLING permission in build.settings:

settings =
{
    android =
    {
        usesPermissions =
        {
            "com.android.vending.BILLING",
        },
    },
}

Finally, the license table must be added to the project config.lua file. Inside this table, the key value should be set to the corresponding key obtained from the Google Play Developer Console.

application = 
{
    license =
    {
        google =
        {
            key = "Your key",
        },
    },
}

Support