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] How do products get automatically restored?

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

Thread Status:
Not open for further replies.
  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:
    220
    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.
     
Thread Status:
Not open for further replies.