Proper documentation

Hi, so I’m having a very hard time setting up UDP In App Purchases in place. I’m currently at the step when I can download my repacked builds to test them on my devices before publishing and I can’t see my in app products when testing the repacked build on my devices, which makes me believe it’s something related to my current configuration, so I decided to start over the UDP setup.

This is my current configuration:
Unity: 2020.1.3f1
OS: MacOS Mojave 10.14.5

My 12 products are set in the default IAP Catalog, which has the “Auto-Init” option turned off, we manually initialize them like this:

public void InitializePurchasing()
{
    // If we have already connected to Purchasing ...
    if (IsInitialized())
    {
        // ... we are done here.
        Debug.Log("[InitializePurchasing] Already initialized, skipping");
        return;
    }

    // Create a builder, first passing in a suite of Unity provided stores.
    var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    var catalog = ProductCatalog.LoadDefaultCatalog();

    foreach (var product in catalog.allValidProducts)
    {
        if (product.allStoreIDs.Count > 0)
        {
            var ids = new IDs();
            foreach (var storeID in product.allStoreIDs)
                ids.Add(storeID.id, storeID.store);
             
            //Add
            builder.AddProduct(product.id, product.type, ids);
        }
        else
        {
            //Add
            builder.AddProduct(product.id, product.type);
        }
    }

    // Kick off the remainder of the set-up with an asynchrounous call, passing the configuration
    // and this class' instance. Expect a response either in OnInitialized or OnInitializeFailed.
    UnityPurchasing.Initialize(this, builder);
}

1 - The game was designed to have IAPs in Google Play, so we enabled them on Project Settings → Services → In-App Purchasing
2 - After enabling them, we imported the Unity IAP from that very same settings page by clicking on the “Import” button
3 - Downloaded the In App Purchasing package version 2.0.6 (also, why there is have to be two different packages for implementing IAPs?)
4 - At this point, when clicking on Unity’s Window menu we can only see the option “Unity IAP” and not “Unity IAP and Distribution Portal” as stated here: UDP via Unity IAP | Unity Distribution Portal | 1.2.0
I believe this is because, as stated by @nicholasr in the last Unity IAP release notes post ( Unity IAP package 4.12.2 is now available page-2) the UDP package is no longer installed as a prerequisite, quote:

- UDP package is no longer installed as a prerequisite

- UDP - if not installed or up-to-date, a menu will prompt you to install or update it upon selecting UDP support features.

5 - So, the ‘Getting started’ guide says it clear: “Do not mix implementations!” (Don’t mix the implementations | Unity Distribution Portal | 1.2.0). How can we follow the very clear instructions to only choose one option (UDP Package or Unity IAP) if we need to manually install yes or yes the UDP package in order to be able to set all this up.

Thanks for the help but I find the documentation misleading, contradictory or perhaps I can’t find the latest updated documentation for the new versions of the packages.

1 Like

In the latest IAP plug-in, IAP and UDP are separated.

Please try to switch the Android target to UDP, if you didn’t import the UDP package, it will prompt you to install it.

6432425--719576--upload_2020-10-19_18-51-44.jpg

6432425--719579--upload_2020-10-19_18-54-12.png

Hi @SamOYUnity3D , thanks for the reply. I know that the popup prompts and asks you to separately download the UDP Plugin, but what I mean is that in the documentation you dramatically insist on just not doing that (i.e. mixing implementations).

You are right, the document has not been updated after the latest IAP version is released, we will note this.

Thank you.

Also if you guys could let us know here whenever you update it so we can continue integrating the plugin I’d appreciate it.

You don’t have to wait until the document is updated to integrate UDP. Actually, if you use the latest IAP package, the only difference between now and before is that you need to import the UDP package separately, and the other integration steps have not changed.

Will do that, thanks

1 Like