Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Implementing Vouchers or Gift-Codes

Discussion in 'iOS and tvOS' started by Cogniad, Oct 14, 2019.

  1. Cogniad

    Cogniad

    Joined:
    Feb 17, 2017
    Posts:
    15
    Hi.
    In the Google Play Store, you're allowed to generate up to 500 gift codes for in-app purchases. As far as I can tell, you can only get 100 in the App Store.

    Is there any way where I could make a system that lets me generate and hand out my own gift codes to be used via UI in-game? Are there any services that allow for this to happen? Or will I have to set up a server for this kind of functionality?

    The primary reason I'm asking is that I'm thinking of starting a crowdfunding campaign, and if I can't offer in-game items in return for donations, then it would be even more unsuccessful than if I had started it with items.

    Thanks.
     
  2. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    You do need a dedicated game server for this. I know at least PlayFab has redeem code feature, and they provide a very generous free tier.

    Do note that Apple may consider this kind of feature as working around the IAP system and would reject the app. The recommended solution is, once you have a game server, to implement an account system and gift your crowdfunders directly to their accounts.
     
  3. Cogniad

    Cogniad

    Joined:
    Feb 17, 2017
    Posts:
    15
    Oh shoot that's actually really important. Have you ever done this account system, and about how much do you think it would cost to maintain a server with said account system?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    A full transaction/billing system? Like PayPal? I doubt users would be willing to enter credit card info into an unknown authority. How are you handing out the gift codes, by email? Perhaps I misunderstand your intent, will there be $ exchanged in-game for this? You can certainly hand out random codes that users enter into the game that unlock items, as long as there is no money exchanged in the process.
     
  5. Cogniad

    Cogniad

    Joined:
    Feb 17, 2017
    Posts:
    15
    Let's say I did a kickstarter, and I got 101 people on iOS. They all paid $10 to $12 in this crowdfunding campaign. I now owe them a little package in the game that's worth about $10 of IAP. I'd send them a code that's generated by the system and they can enter it in to redeem the stuff they reserved in the Kickstarter.

    That's the idea anyways.

    The reason I don't use the the iOS and Google Play built in codes is because there are hard limits.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes then my approach would work for you.
     
  7. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    At least I know PlayFab has this plug-and-use account system. Take a look at their official website and tutorials. It will give you an idea how it works. I'm also working on adding account to my already live game.

    As for the cost, you can look at PlayFab's free tier limit and see where you can potentially go overboard. If you only use their service for very minor stuff (like only saves IAP unlocks) then as far as I can see you don't need to pay even a penny.
     
    Cogniad likes this.
  8. Cogniad

    Cogniad

    Joined:
    Feb 17, 2017
    Posts:
    15
    Ok, but is that through my internal system for handing out codes or through the App Store's system of handing out codes?

    The App Store has a hard limit at 100 promo codes in their system whereas the Google Play Store has 500.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You send out a code via email after they have made a donation on your website. The code might look like "ABC123". In your game, you have the user enter the code into an input field. In the OnClick event, you have an IF statement (likely a hash lookup) where you have:

    if (inputStr == "ABC123") // in the list of valid codes, you really would't use an IF statement
    {
    awardProductToUser()
    }
     
  10. Cogniad

    Cogniad

    Joined:
    Feb 17, 2017
    Posts:
    15
    True, but what stops them from sending that code to all of my other users? Then with that single code, "ABC123" five thousand users could get it without paying me.
    This is why I figured server-side code would have to be implemented.
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Five thousand? I'm being practical, some users may share, but why be concerned. More people would be playing your game :) Spend more time creating a great game!
     
  12. Cogniad

    Cogniad

    Joined:
    Feb 17, 2017
    Posts:
    15
    I've already purchased Unity Plus with the intent of implementing analytics. I intend to make this somewhat profitable.

    Yes, I don't know what I'm doing. But I'm going to try. lol
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You don't need Plus to implement Analytics, it comes with the free version also.