Skip to content

jarnik/ouya_iap_openfl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OUYA In App Purchases with OpenFL

A simple example that shows how to get the product list, receipts and purchase a product.

Using:

Example:

What the current example does:

  • fetch the test product information and receipts
  • display a large O icon, unless you have purchased the test product
  • press any OUYA controller button to purchase the product
  • hide the O icon on successful purchase

There are no other visuals, you'll have to watch the console output using 'adb logcat'.

Getting started:

You will need:

Enter the above mentioned into the Main.hx.

The latest version of openfl/openfl-native is missing the "createInterface" method - I guess jgranick had it in his working copy but did not push to the repo. As a temporary solution, you will have to comment out every reference to "createInterface" within "C:\HaxeToolkit\haxe\lib\openfl-ouya/1,0,2/tv/ouya/console/api/OuyaResponseListener.hx" or any other class using it.

IAPHandler.hx class defines multiple callback methods (onProductListReceived, onPurchaseSuccess, etc.). Subclass it and override the methods with your own handlers. One such example subclass is a MyIAPHandler.hx.

The JNI bindings are contained within a src\java\com\jarnik\iaptest\OUYA_IAP.java class. It's mostly a copy-pasted "iap-sample-app" from the ODK.

Contributing:

My Java and JNI knowledge is fairly limited, so please don't hesitate to contribute with better methods. The openfl-ouya contains some part of ODK IAP API, but I couldn't get it to work, so I made this crude wrapper.

About

OUYA In App Purchases with OpenFL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published