AIROUYAFacade is a native extension to use OUYA services. It provides developers with a set of useful methods to customize the gameplay sessions and allow in-app purchases, for instance. Among the available features, the extension allows an application to read and write game data (e.g. highscore), monitor menu events and get the name and uuid of current gamers.

It is also possible to work with in-app purchases, read product information, fire purchase requests and receive receipts. There are events that can be used to monitor all actions, which are asynchronous. Despite of that the extension has an internal cache mechanism to prevent unnecessary server communication.

Sample

var ouyaFacade:AIROUYAFacadeANE;
ouyaFacade = AIROUYAFacadeANE.getInstance( "your-developer-key-here", key );

ouyaFacade.addEventListener( AIROUYAFacadeANEEvent.GAMER, onGamer );
ouyaFacade.addEventListener( AIROUYAFacadeANEEvent.PRODUCT, onProduct );

ouyaFacade.getGamerInfo();

ouyaFacade.putGameData( "high_score", "1,2,3,4,5,6,7,8,9,10" );
var test:String = ouyaFacade.getGameData( "high_score" );

ouyaFacade.requestProductList( "test", "test_entitlement" );

function OUYAMenuUpdate( facadeEvent:AIROUYAFacadeANEEvent ):void {
	trace( "OUYA Menu Event!" );
}

private function onGamer( facadeEvent:AIROUYAFacadeANEEvent ):void {	
	var gamer:Gamer = facadeEvent.data as Gamer;
	if( null != gamer ) {
		trace( "Gamer Username: " + gamer.username + ", and UUID: " + gamer.uuid );
	}
	
	var gamer2:Gamer = this.ouyaFacade.getGamerInfo();
	if( null != gamer2 ) {
		trace( "Gamer 2 Also shows Username: " + gamer2.username + ", and UUID: " + gamer2.uuid );
	}
}

private function onProduct( facadeEvent:AIROUYAFacadeANEEvent ):void {	
	var products:Vector = this.ouyaFacade.getProductList();
	
	var i:int = 0;
	while( products.length > i ){
		trace( "Product " + i + " is: " + products[i].name + " and costs: " + products[i].originalPrice );
		i++;
	}
	
	ouyaFacade.addEventListener( AIROUYAFacadeANEEvent.PURCHASE, onPurchase );
	ouyaFacade.makeProductPurchase( products[0].identifier );
}

private function onPurchase( facadeEvent:AIROUYAFacadeANEEvent ):void {	
	trace( "Product Purchase Request Result: " + facadeEvent.status + ", " + facadeEvent.data );
	ouyaFacade.addEventListener( AIROUYAFacadeANEEvent.RECEIPT, onReceipt );
	ouyaFacade.getProductReceipt();
}
Air Native Extension, Android. URL.