Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Scripting Reference for In App Purchasing package nowhere to be found?

Discussion in 'Unity IAP' started by CanisLupus, Jul 26, 2019.

  1. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    364
    I was told (original post here) that the documentation pages moved to the Packages section of the docs and we are now supposed to open the Package Manager and use the documentation link for each package. OK. However...

    The In App Purchasing package seems to send us to:
    https://docs.unity3d.com/Packages/com.unity.purchasing@2.0/index.html
    Which redirects to:
    https://docs.unity3d.com/Manual/UnityIAP.html
    Which is a set of manual pages, so we still can't see the scripting reference.

    For example, searching for IStoreController here shows some pages in the results, but none for the scripting reference (although there are examples). If we want to see the documentation for a less used method like FetchAdditionalProducts, it's nowhere to be found (actually, we can't find the correct way to use this method anywhere, even on Google, but that's another problem).

    Where is the scripting reference? Thanks!

    Daniel
     
  2. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    364
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,654
    I have let the documentation team know, but I have not heard back. If you have a specific question (other than where are the docs :) ) I would be happy to assist.
     
  4. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    364
    Thank you, Jeff. :) Actually, we have questions. How is FetchAdditionalProducts used exactly? The lastest docs we found are not clear enough, I think.

    FetchAdditionalProducts receives a HashSet of ProductDefinitions, in contrast with the normal initialization using Initialize, which receives IDs as strings and product types (through the Builder). Our understanding is that we need to construct the ProductDefinitions we want to fetch (since they don't exist yet) and send those to FetchAdditionalProducts. So we do something like this (simplified version):

    Code (CSharp):
    1. private void Initialize()
    2. {
    3.    ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    4.    builder.AddProduct(someId, ProductType.NonConsumable);
    5.    UnityPurchasing.Initialize(this, builder);
    6. }
    7.  
    8. private void RefreshProducts()
    9. {
    10.    var products = new HashSet<ProductDefinition>();
    11.    products.Add(new ProductDefinition(someOtherId, ProductType.NonConsumable));
    12.    storeController.FetchAdditionalProducts(products, null, null);
    13. }
    Would this be correct? We found other forum posts like this one that pass an empty HashSet, which seems....weird? But no one replied that it's wrong. It's also not the only post we found that did that, but I can't find the other(s).

    So, is our approach correct? Anything we should know?

    Cheers!
    Daniel
     
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,387

    Yes, that approach looks correct.
     
    CanisLupus likes this.
  6. CerberusInteractive-Morgan

    CerberusInteractive-Morgan

    Joined:
    Aug 25, 2016
    Posts:
    19
    This is still an issue. Any updates?
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,654
    Do you mean issue with the documentation? The IAP documentation is currently in our back log.
     
  8. CerberusInteractive-Morgan

    CerberusInteractive-Morgan

    Joined:
    Aug 25, 2016
    Posts:
    19
    Yeah I meant an issue with documentation. Good to hear it is tasked out now. I had gotten in contact with Unity support and got my documentation questions answered. Thanks!
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,654
    Yes, we're actively meeting and working on it!
     
  10. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    364
    Any news about this? There's still no scripting reference that I can find, sadly.
     
  11. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    7,654
  12. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    364
    When I posted I was researching subscriptions, but I managed to find what I wanted to know with a mixture of the IAP demo .cs file and this *manual* page, so nothing specific at the moment. Thanks!

    It was at that point that I found the other thread where it says that UWP subscriptions are not supported and I threw my hands up in despair. I was hoping I could find that (very relevant) piece of information somewhere in the docs. ;)
     
unityunity