1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Reddit AMA with Adam Myhill on Cinemachine, Thurs July 27 - 10AM PT. More info.
    Dismiss Notice
  6. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  7. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

How do products get automatically restored?

Discussion in 'Unity IAP' started by claris, Apr 21, 2017.

  1. claris

    claris

    Joined:
    Aug 5, 2015
    Posts:
    6
    The documentation says that "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."

    I have implemented the IAP codes on my store page, but I am not sure if a user reinstalls the app, without going to the store page, how does Unity restore the products so that the correct games are unlocked? On the menu screen, the app should already be able to tell which products the user has purchased. Do I have to include the IAP codes on the menu screen to do that?
     
  2. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    11
    Hi.
    You don't have to attach your IAP codes on store page. You can attach it on any GameObject.
    We have a "IAP Demo" scene in Plugins/UnityPurchasing/scenes. In this demo, we attached IAPDemo.cs on UnityIAP object. So once the scene is loaded, Unity IAP is initialized. And then you'll get all information you need.