Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Restoring Transactions for every session

Discussion in 'Unity IAP' started by r137, May 1, 2018.

  1. r137

    r137

    Joined:
    Mar 12, 2018
    Posts:
    8
    According to docs restoring transactions for non-consumable IAPs only works for first session of reinstallation:
    https://docs.unity3d.com/Manual/UnityIAPRestoringTransactions.html

    I want to add "remove ads" IAP to my game. Isn't it convenient to check if user have this item or not for every session start ? By default, restoring transactions works only once when user deletes the game and reinstalls it. So, I need to store this information by using less secure ways like PlayerPrefs. I don't want to do this because of security concerns. PlayerPrefs or any other local file based options can be edited easily by user.

    Is it possible to force restoring products every time user starts the game ? I understand on iOS this is not possible because user needs to enter password to restore products but on Android this is not needed. I am using codeless IAP and I am able to this by some hacks (by editing IAPButton.cs's OnInitialized method) but this doesn't look like appropriate method.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,115
    You would want to implement your own product inventory solution, this is something we are considering in a future release. One thing you might try (but not directly supported) is to return Pending instead of Complete from ProcessPurchase. This might trigger another ProcessPurchase the next time the app is started.
     
  3. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
  4. VuHuyHoang

    VuHuyHoang

    Joined:
    Jun 29, 2016
    Posts:
    2
    Same problem !
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,115
    Please describe your problem
     
  6. the_lemur

    the_lemur

    Joined:
    Apr 3, 2013
    Posts:
    104
    It's not made clear in the docs if this information is still available if the network is down or the play store is down. Is the state of product receipts stored locally, or is it read from the store? Otherwise you'd lock up your entire purchased inventory.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,115
    Read from the store. It's best to use local (or cloud) inventory management for purchases.
     
  8. the_lemur

    the_lemur

    Joined:
    Apr 3, 2013
    Posts:
    104
    Thanks. I wasn't sure so I just did both and merged the results.