ouya.*

Type library
Revision Current Public Release (2014.2393)
Keywords OUYA
Availability Pro, Enterprise
Platforms Android

Overview

The OUYA plugin allows you to build games supported on the OUYA system. This plugin adds an interface for in-app purchases (entitlements and consumables) as well as support for accessing the gamer unique identifier.

Functions

ouyaSDK.ouyaSetDeveloperId

Before IAP functions can be invoked the developer id must be set. This developer id corresponds with the signing key, and bundle id, and needs to match for proper encryption/decryption.

ouyaSDK.asyncLuaOuyaFetchGamerUUID

Requires developer id to be set.

This method has success, failure, and cancel callbacks.

The success event provides access to the gamer's unique identifier.

ouyaSDK.asyncLuaOuyaRequestProducts

Requires developer id to be set.

This method has success, failure, and cancel callbacks.

The success event provides access purchasable details for name, description, and price for the given entitlement/consumable purchasable identifier.

The failure event provides an error code and description.

The cancel event provides no arguments and indicates the request was cancelled.

ouyaSDK.asyncLuaOuyaRequestPurchase

Requires developer id to be set.

This method has success, failure, and cancel callbacks.

The success event provides opens the purchase dialog for the requested purchasable identifier.

The failure event provides an error code and description.

The cancel event provides no arguments and indicates the request was cancelled.

ouyaSDK.asyncLuaOuyaRequestReceipts

Requires developer id to be set.

This method has success, failure, and cancel callbacks.

The success event returns the list of receipts associated with the bundle identifier for the gamer.

The failure event provides an error code and description.

The cancel event provides no arguments and indicates the request was cancelled.

plugin_ouya.developerId = "310a8f51-4d6e-4ae5-bda0-b93878e5f5d0";

Be sure to set your developer id from the developer portal.

plugin_ouya.initialize

Common method handles initialization for the wrapper methods.

plugin_ouya.ouyaSetDeveloperId

Wraps calling ouyaSDK.ouyaSetDeveloperId so that the plugin is only initialized once.

plugin_ouya.asyncLuaOuyaFetchGamerUUID

Wraps calling ouyaSDK.asyncLuaOuyaFetchGamerUUID to check if the plugin has been initialized before invoking.

plugin_ouya.asyncLuaOuyaRequestProducts

Wraps calling ouyaSDK.asyncLuaOuyaRequestProducts to check if the plugin has been initialized before invoking.

plugin_ouya.asyncLuaOuyaRequestPurchase

Wraps calling ouyaSDK.asyncLuaOuyaRequestPurchase to check if the plugin has been initialized before invoking.

plugin_ouya.asyncLuaOuyaRequestReceipts

Wraps calling ouyaSDK.asyncLuaOuyaRequestReceipts to check if the plugin has been initialized before invoking.

Signing Key

Remember to include the key.der signing key from the OUYA developer portal inside your main Corona project directory, alongside main.lua.

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.ouya"] =
        {
            publisherId = "tv.ouya",
            supportedPlatforms = { android=true },
        },
    },
}

In addition, you must add an intent filter to the android table within build.settings so that your game icon will appear in the OUYA Play section:

settings =
{
    android =
   {
        mainIntentFilter =
        {
        categories = { "tv.ouya.intent.category.GAME" },
        }
    },
}

Sample Code

Documentation

https://devs.ouya.tv/developers/docs/corona/

Support