IAP Question RE Evolving List of Purchaseables

EricJ13EricJ13 Posts: 24Member
I'm experimenting with IAP and have a question pertaining to "Enter your purchasables into the OuyaGameObject. The developer creates purchasables in the developer portal. And then the OuyaGameObject has a ProductKey list where you enter the product app ids from the developer portal." from the Scene Products Example/Script section of https://devs.ouya.tv/developers/docs/unity

Do I understand correctly that for a product to be displayed within my game it has to be hard coded into the OuyaGameObject at compile time? As I create new purchaseables do I have to re-compile and submit my game for the to be available to players?

Comments

  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    edited August 2013
    That list is a bad example. Mainly because you only purchase one thing at a time. I was using the list to show items in a store or something...

    Follow the ShowProducts example.

    First check your player prefs to see if the game is unlocked.

    If the purchase is not found in player prefs, check receipts for your purchaseable. If you find the item was purchased then set a player pref for the game being unlocked.

    If the player pref key and the purchase is not found, show the buy button. The buy button invokes OuyaSDK.requestPurchase("purchase identifier"). Upon a successful purchase set the player pref that the game is unlocked.

    Whenever you invoke in-app-purchase methods, wait for the callback before invoking another.

    I have also added my own timeouts, in case there's some reason you didn't get a callback response.
    Post edited by tgraupmann on
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • KonajuGamesKonajuGames Posts: 560Member
    The purchasables you add to the OUYA dev portal go into one list for you as a publisher.  This is a list that covers all your games.  Therefore the game must know which purchasables are relevant to it.  There is no method available for a game to retrieve a list of all the purchasables you have added to the portal, so your game must get the list from somewhere else.  This can either be hard-coded into the game, or could be retrieved from a server that you control.  I plan to use the second option.  When the game launches, it will query my server for a list of the purchasables relevant to that game.  The game then passes these purchasables to requestProductList() to get the purchasable info from OUYA.  I can then update the data on my own server at any time and add or remove purchasables as I wish.
Sign In or Register to comment.