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

Unity IAP Tutorial

Discussion in 'Unity IAP' started by Omar-Balfaqih, Oct 5, 2018.

  1. Omar-Balfaqih

    Omar-Balfaqih

    Joined:
    Apr 23, 2013
    Posts:
    14
    Hi there lovely community,

    Few months back I created a tutorial in Arabic with English subtitles how can you implement Unity IAP (In-App Purchase) into your game. In the tutorial I used GooglePlay as the platform, it is similar to do so for the AppStore. I have seen a lot of people were watching it and they were asking couple of questions.
    So I decided to share the tutorial with you and the most common two questions I got.



    Q / How to keep track of whatever the user has purchased?
    A /
    To keep track of his/her purchase, you simply use PlayerPrefs to tell your game that this user has purchased it already.

    Q / What if the player deleted my game, how can I restore his purchase?
    A /
    First, restoring is only valid for "non-consumable" purchases which you only can buy once like player costumes (hats, dresses, characters and so on).

    To read more about IAP restoring you can refer to these two Unity's documentation pages:
    https://docs.unity3d.com/Manual/UnityIAPRestoringTransactions.html
    and
    https://docs.unity3d.com/Manual/UnityIAPIStoreRetrievingProducts.html

    Hope that helps.
    Just let me know if you got any question or request, I'd be more than happy to answer you!

    To keep in touch you can find all my social media in my website:
    http://obalfaqih.com
    And to check latest updates, you can follow my FB page:
    http://fb.com/obalfaqih

    Good luck & happy learning,
    Omar Balfaqih
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Looks good. One note, be sure to test the reinstall scenario as it would delete PlayerPrefs.
     
    Omar-Balfaqih likes this.
  3. Omar-Balfaqih

    Omar-Balfaqih

    Joined:
    Apr 23, 2013
    Posts:
    14