store.*

Type Library
Revision 2016.2825
Keywords store, IAP, Google IAP
Platforms Android

Overview

The Google IAP plugin allows you to support in-app purchases using Google's in-app billing service.

For more information see the In-App Purchases (IAP) guide.

Gotchas

When building an app using the Google IAP plugin, ensure that the following options in the build dialog window (guide) match the .apk you've already uploaded to the Google Play Developer Console:

Syntax

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

Properties

Functions

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",
        },
    },
}

Project Configuration

To use Google IAP, 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",
        },
    },
}

Implementation

For guidelines on how to implement and use Google IAP, please see the In-App Purchases (IAP) guide.