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

[Solved] Google Play Vouchers and UnityIAP

Discussion in 'Unity IAP' started by FlashMuller, Jul 18, 2018.

Thread Status:
Not open for further replies.
  1. FlashMuller

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    450
    I plan on giving out vouchers to users for my game Trains. Google says, that you have to

    "call the queryPurchases() method whenever the app starts or resumes. "



    Is that requirement met with IAPs retreiving products? From the docu:

    On platforms that support it (e.g. Google Play and Universal Windows Applications) Unity IAP automatically restores any products the user owns during the first initialization following reinstallation; the ProcessPurchase method of your IStoreListener will be called for each owned item.
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @FlashMuller

    Yes, Unity IAP should support vouchers from Google Play Store.

    You will need to initialize the Purchasing system as soon as your game starts, to ensure that the transaction is caught and processed correctly.
     
  3. niknakgames

    niknakgames

    Joined:
    Aug 7, 2015
    Posts:
    25
    I am using codeless IAP Buttons and purchasing and everything works great, but when I try to use promo codes nothing happens, but the codes are "used". Is there something more I need to do? I have
    "Automatically Initialize Unity Purchasing" checked.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What In App products are you promoting? (as opposed to a voucher for the game itself). The Successful Purchase button action should fire. What method do you have connected for this? Can you provide a screenshot of your Inspector for one of your Produce Purchase buttons?
     
  5. niknakgames

    niknakgames

    Joined:
    Aug 7, 2015
    Posts:
    25
    It's a simple remove ads IAP or a simple increase currency.
    Does the GameObject need to be active when the app starts just like when processing the purchase from in the game? This would make sense. They would have to be hidden though, yeah? Or is there a different way of going about this.

    Very simple methods that gives the IAP


    IAP1.PNG IAP2.PNG
     
    Last edited: Aug 6, 2018
  6. niknakgames

    niknakgames

    Joined:
    Aug 7, 2015
    Posts:
    25
    Would an empty game object in the main scene work? They would never get disabled and have the IAP buttons attached, even though there is no real button.

    Capture.PNG
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
Thread Status:
Not open for further replies.