Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

how to make user input promo code

Discussion in 'Unity IAP' started by Madfool, Jun 19, 2020.

  1. Madfool

    Madfool

    Joined:
    Feb 7, 2020
    Posts:
    6
    Hello, I have Unity 2019.1.02f and I want the user to be able to input the promo code in text field in app and subscribe, is this possible?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    What type of promo code are you referring to? How are your users getting the code?
     
  3. Madfool

    Madfool

    Joined:
    Feb 7, 2020
    Posts:
    6
    Hello Jeff,

    Android, I know how to generate the code in Play console.

    I will send it to a selected number of users using email, but instead of redeeming it in the store I want to redeem it through the app, also the purchases in our app is a monthly subscription, will it be possible to give a one month free using promo codes?

    Thanks.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    The in-game feature is not currently supported. However, if the user redeems their promo code in Google Play, the hope is that a ProcessPurchase will be triggered upon IAP initialization, but I haven't tested it.
     
  5. Splatoon3DS

    Splatoon3DS

    Joined:
    Dec 7, 2022
    Posts:
    1
    Hello. I also want a promocode feature to unlock new items in 5.4.3f1 version for a 3DS game.
    But i dont know what type of C# code to use. Please help me if you have my Answer. Thanks :)
     
  6. John_Corbett

    John_Corbett

    Unity Technologies

    Joined:
    May 17, 2019
    Posts:
    151
    Hi @Splatoon3DS ,

    I'm not sure exactly how to help you, since I can't see your custom implementation of a 3DS store. I do know that in the case of other stores, entering a promo code will award the item in-app when purchases are retrieved on initialization or when a restore purchase is called. In specific app store implementations, we also poll the store for new purchases when the game is unpaused (usually because changing apps or entering a promo code promt in an OS layer to enter a code pauses the game).

    It's possible your custom store will retrieve the purchases appropriately when retrieving/restoring them. You'd have to test it.