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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

How to handle non-consumables after purchase complete

Discussion in 'Unity IAP' started by BeeSmart, Apr 30, 2019.

  1. BeeSmart

    BeeSmart

    Joined:
    Dec 6, 2013
    Posts:
    22
    Hi, Hopefully this is not a "stupid" question and can help others (including myself) as they tread the IAP waters. I have 4 demo non-consumables in a demo app. Presently testing on Android but will get it working on iOS soon.

    Windows 10
    Unity 2018.3.3f1
    IAP Version 1.22.0


    non-consumables included in this demo
    1. No-Ads
    2. Full Access + No-Ads (Includes 1, 3, 4)
    3. Test Package1
    4. Test Package2

    I am using Codeless IAP and have not implemented IStoreListener within my IAPMgr class. Created two methods within my IAPMgr.cs file, called BuyComplete and BuyFailed within BuyComplete I am passing the product.definition.id to another method which takes the appropriate action. i.e. stopping/hiding adds, unlocking everything, making the appropriate UI changes as needed.

    OK. now the question. What is the best practice for keeping record on the client side that the person made the non-consumable purchase, so when they run the app again, those purchased non-consumables items will be there?

    I have yet to find a clear answer on this along with how to handle app re-install.

    Thanks for the help,

    Chris
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    The easiest solution is to save to PlayerPrefs. Many studios choose to save user purchases to a cloud server.
     
  3. BeeSmart

    BeeSmart

    Joined:
    Dec 6, 2013
    Posts:
    22
    Thanks Jeff. Is there not a way to query the appropriate store to get a list of non-consumable purchases in realtime? I would like to use PlayerPrefs as a no internet backup. Thanks again. Chris