Search Unity

[IAP] Implementing a Store, IStoreListener, IStore or IStoreCallback?

Discussion in 'Unity IAP' started by esteban16108, Jun 30, 2018.

  1. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    159
    Hi,

    So, I implemented my store already using https://unity3d.com/learn/tutorials/topics/ads-analytics/integrating-unity-iap-your-game as an example... but looking at the docs I found some other Interfaces to implement like IStore and IStoreCallback that are not being used on the example above.

    Is the documentation kind of incomplete? It's ok just to implement IStoreListener? Because the one having RetrieveProducts method is IStore... etc...

    Just kind of confusing.

    Thanks.

    E.
     
  2. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,268
    Basically you only need to implement the IStore + IStoreCallback etc. classes if you're about to implement a whole new store that is not supported by Unity IAP yet. E.g. for PayPal, or Steam, you would wrap their plugin callbacks into those Unity IAP classes.

    You don't need to call RetrieveProducts either when using Unity IAP. It calls OnInitialized with all products for you when it's done initializing.
     
    Zamaroht likes this.
  3. esteban16108

    esteban16108

    Joined:
    Jan 23, 2014
    Posts:
    159
    @Baroni I see thanks... so in my case I will only need IStoreListener.
     
  4. LiveOrDevTrying

    LiveOrDevTrying

    Joined:
    Nov 27, 2016
    Posts:
    2
    Ty. These posts are extremely informative. - Rob
     
    Zamaroht likes this.
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You only need to implement those methods if you are building your own online store, and not using Google Play or the Apple App Store. Otherwise, they are already present. See the Sample IAP Project here for a working example https://forum.unity.com/threads/sample-iap-project.529555/ And by online store, I don't mean the store within your game, I meant the store on your web servers, where you would need to implement credit card processing, online security, etc. This is a lot of work, you would be advised to use the existing stores.
     
    Zamaroht likes this.