The Daily Click ::. Forums ::. Klik Coding Help ::. OUYA in-app purchase tutorial
 

Post Reply  Post Oekaki 
 

Posted By Message

Display Name



Registered
  07/04/2004
Points
  196
5th November, 2013 at 05/11/2013 20:18:21 -

This is how you create an in-app purchase

Image

Set your product at ouya devs
https://devs.ouya.tv/developers/products
Image

2) set new product
Image
Set product ID ( unique name )
Give your product a name ( The name of your game )
Set price

Type of product:
Entitlement ....... means you can only buy it once
Consumable ........ means it can be used as many times as you want ( example buy items or extra levels )

Once you are done setting up your product

Image
Image

Make sure you have the OUYA object added
Image


create a new condition
Start of Frame. Then right click under the ouya object and select Initialize API ( ignore system double tap, that's just to exit the system properly)
Image


Enter your developer ID
Image


When you click okay, it will ask you for the key.der
Image


--------------------------------------------------------------------------------------------------
Here is where you get your Developer ID ( Dev ID )
Image


This how you download your key.der, make sure you right click as save as... key.der
Image


Now, click on new condition. Right Click on the OUYA object and pick " On API Initialized "
Image


( this step is not necessary but it's a good idea to display if the API has started )
You can type anything you'd like here. (Remember you need to add a text string for this step)
Image


Now, Right click under the OUYA object and select Set Product
and type the product name
Image


Now that the product is selected, it's time to buy it.
If the user presses Y the product will be bought.
Image

Image


Insert a condition so the product can only be bought if counter = 0
Image


Again, make sure you have a counter added. The expression should look like this
Image


If the user already has the product the counter will be set to 1 ( so they can't buy it again or you remove the purchase option )
New condition. Select API. Does player have product?
Image


and if the player has the product, you set the counter to 1 as shown in this pic
Image


Okay you are done. That is all you need to make an in-app purchase in Fusion.
Okay. Let's test it on the OUYA.
Export your .APK and load it to your OUYA. Via USB STICK, FTP...Dropbox or whatever means.

if the API starts correctly you will see the string you entered. In this case it is: WHOOT WHOO API STARTED -
Image


Press Y to buy the product, when you press Y it should look like this.
Image


Buy your product( Don't worry OUYA doesn't charge you for buying your own products, you can delete the purchase at anytime)
Image


Now the counter is set to 1, so you cannot buy the product again. or you can use the number to remove the purchase option.
(consumables can be bought as many times as you want and you won't need a counter)
Image


Check that the transaction - and Boooom - you are done!
Image


Enjoy.

Here is the finished product.
( remember to change the product ID and import your key )

http://in-app-ouya-tutorial-fusion.weebly.com/uploads/2/4/5/4/24545236/in-app-purchase-ouya.mfa


Edited by Display Name

 
n/a

Liquixcat

Administrator
Lazy Coder

Registered
  08/12/2002
Points
  201

VIP MemberLikes TDCKitty
5th November, 2013 at 05/11/2013 21:02:10 -

Very useful post, but, there is actually an Articles section specifically for this purpose, Sparckman.

Edited by an Administrator

 
thinking is like pong, it's easy, but you miss sometimes.

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
5th November, 2013 at 05/11/2013 21:16:00 -

Have you tried selling anything on OUYA?
How have sales been?

I know the OUYA hasn't had great reception after launch, so I'm just wondering if it would be worth it to me.
I might launch Rodent Rush on the platform if so.

 
n/a

Liquixcat

Administrator
Lazy Coder

Registered
  08/12/2002
Points
  201

VIP MemberLikes TDCKitty
5th November, 2013 at 05/11/2013 22:11:11 -

Well Clickteam and Ouya are in a back and forth right now in communication. So hopes are high.

 
thinking is like pong, it's easy, but you miss sometimes.

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
6th November, 2013 at 06/11/2013 03:52:38 -

Well I'm on their mailing list, and Google+ page and seems like they're begging for more developers.
Also if you read comments from around the web most users aren't happy with the device.

I would like to get my game on it though anyway.

 
n/a

Yai7

Peace & Love

Registered
  28/01/2002
Points
  3178

6th November, 2013 at 06/11/2013 08:42:50 -

This is a useful article as I already noted.
Gratitude to your work.

 
(=
   

Post Reply



 



Advertisement

Worth A Click