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

Pre-Register Playstore Rewards

Discussion in 'Unity IAP' started by SAVVU, Nov 11, 2019.

  1. SAVVU

    SAVVU

    Joined:
    Dec 6, 2015
    Posts:
    21
    Hey,
    So I just published my game on Playstore for Pre-Register and also set up a reward in the Developer console that will be delivered to players as soon as I publish the game.
    The problem is that I can't find a way to implement this function iside of Unity. Google says that it has a similar implementation as promotions with promo codes!
    Below I have a screenshot from the Google Billing Promo Support. How can I have access to this functions inside of Unity?
    I should also mention that I already use IAP in this game that work but without having a product catalog in Unity, just a script that handles the purchase and buttons that call functions inside of the script.
    Exactly like this Tutorial: https://learn.unity.com/tutorial/unity-iap#5c7f8528edbc2a002053b46e

    Now I really need to know how to handle the Pre-Register rewards!
    Thanks for your help,
    SAVVU
     

    Attached Files:

  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    603
    We do not have a tutorial on pre-registration. My understanding is that after the IAP is initialized, the IAP will get the products owned by the user, and you should grant it to the user in ProcessPurchase. https://docs.unity3d.com/Manual/UnityIAPProcessingPurchases.html
     
    StartStart likes this.
  5. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    Thank you @SamOYUnity3D !

    If it's automaticly send that callback then I just catch that callbacks.
     
  6. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    603
    Yes, you may also need to define the Products in scripts. https://docs.unity3d.com/Manual/UnityIAPDefiningProducts.html
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Purchasing;
    3.  
    4. public class MyIAPManager {
    5.     public MyIAPManager () {
    6.         var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    7.         builder.AddProduct("100_gold_coins", ProductType.Consumable, new IDs
    8.         {
    9.             {"100_gold_coins_google", GooglePlay.Name},
    10.             {"100_gold_coins_mac", MacAppStore.Name}
    11.         });
    12.         // Initialize Unity IAP...
    13.     }
    14. }
     
    StartStart likes this.
  7. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    Yep already defined. Thank you a lot!
     
    SamOYUnity3D likes this.
  8. thebrad52

    thebrad52

    Joined:
    Jun 12, 2019
    Posts:
    4
    How do I implement the reward?
     
  9. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    Handle it like In-App-Purchase. Just think about pre-register is automatic IAP that will give to you when IAP is initalized.