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

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:

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

Anyone? Perhaps @JeffDUnity3D ?

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 :slight_smile: ) I would be happy to assist.

Thank you, Jeff. :slight_smile: 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):

private void Initialize()
{
   ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
   builder.AddProduct(someId, ProductType.NonConsumable);
   UnityPurchasing.Initialize(this, builder);
}

private void RefreshProducts()
{
   var products = new HashSet<ProductDefinition>();
   products.Add(new ProductDefinition(someOtherId, ProductType.NonConsumable));
   storeController.FetchAdditionalProducts(products, null, null);
}

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

Yes, that approach looks correct.

1 Like

This is still an issue. Any updates?

Do you mean issue with the documentation? The IAP documentation is currently in our back log.

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!

Yes, we’re actively meeting and working on it!

Any news about this? There’s still no scripting reference that I can find, sadly.

There have been no major changes, these docs are still relevant Unity - Scripting API: IStoreController What specific problem are you trying to solve?

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. :wink: