amazon.iap.*

Type Library
Revision Current Public Release (2016.2992)
Keywords Amazon, IAP, in-app purchases
Platforms Android

Overview

The Amazon IAP plugin lets you sell digital content and subscriptions from within your apps, including in-game currency, expansion packs, upgrades, magazine issues, and more.

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

Notes
  • This plugin corresponds to Amazon IAP v2. If you are migrating from the previous version to v2, please see the migration page for a summary of changes.

  • Before using the Amazon IAP plugin, please familiarize yourself with the Amazon in-app purchasing workflows.

  • You must install the Amazon App Tester or publish your app in the Amazon Appstore to use this plugin. Details on testing can be found here.

Registration

To use Amazon In-App Purchasing, you must distribute your app in the Amazon Appstore. Please register for an account before proceeding.

Syntax

local store = require( "plugin.amazon.iap" )

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.amazon.iap"] =
        {
            publisherId = "com.coronalabs"
        },
    },
}

Enterprise

To use this plugin with Corona Enterprise:

  1. Copy plugin.amazon.iap.jar and in-app-purchasing-2.0.61.jar into the libs/ directory of your project.

  2. Add the following section into your AndroidManifest.xml file, inside the application tag:

<receiver android:name = "com.amazon.device.iap.ResponseReceiver">
    <intent-filter>
        <action android:name = "com.amazon.inapp.purchasing.NOTIFY"
            android:permission = "com.amazon.inapp.purchasing.Permission.NOTIFY"/>
    </intent-filter>
</receiver>
  1. Also, set targetedAppStore to "amazon" in your AndroidManifest.xml file:
<meta-data android:name="targetedAppStore" android:value="amazon"/>

Support