Search Unity

Question Proper documentation

Discussion in 'Unity Distribution Portal (UDP)' started by cgascons, Oct 15, 2020.

  1. cgascons

    cgascons

    Joined:
    Feb 22, 2016
    Posts:
    25
    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:

    Code (CSharp):
    1.    
    2. public void InitializePurchasing()
    3. {
    4.     // If we have already connected to Purchasing ...
    5.     if (IsInitialized())
    6.     {
    7.         // ... we are done here.
    8.         Debug.Log("[InitializePurchasing] Already initialized, skipping");
    9.         return;
    10.     }
    11.  
    12.     // Create a builder, first passing in a suite of Unity provided stores.
    13.     var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    14.     var catalog = ProductCatalog.LoadDefaultCatalog();
    15.  
    16.     foreach (var product in catalog.allValidProducts)
    17.     {
    18.         if (product.allStoreIDs.Count > 0)
    19.         {
    20.             var ids = new IDs();
    21.             foreach (var storeID in product.allStoreIDs)
    22.                 ids.Add(storeID.id, storeID.store);
    23.              
    24.             //Add
    25.             builder.AddProduct(product.id, product.type, ids);
    26.         }
    27.         else
    28.         {
    29.             //Add
    30.             builder.AddProduct(product.id, product.type);
    31.         }
    32.     }
    33.  
    34.     // Kick off the remainder of the set-up with an asynchrounous call, passing the configuration
    35.     // and this class' instance. Expect a response either in OnInitialized or OnInitializeFailed.
    36.     UnityPurchasing.Initialize(this, builder);
    37. }
    38.  
    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: https://docs.unity3d.com/Packages/com.unity.purchasing.udp@1.2/manual/UDP_via_Unity_IAP.html
    I believe this is because, as stated by @nicholasr in the last Unity IAP release notes post (https://forum.unity.com/threads/unity-iap-store-package-2-0-0-is-now-available.415517/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!" (https://docs.unity3d.com/Packages/c....2/manual/Do_not_mix_the_implementations.html). 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.
     
    Last edited: Oct 16, 2020
    SamOYUnity3D likes this.
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    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.

    upload_2020-10-19_18-51-44.png

    upload_2020-10-19_18-54-12.png
     
  3. cgascons

    cgascons

    Joined:
    Feb 22, 2016
    Posts:
    25
    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).
     
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    You are right, the document has not been updated after the latest IAP version is released, we will note this.
     
  5. cgascons

    cgascons

    Joined:
    Feb 22, 2016
    Posts:
    25
    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.
     
  6. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    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.
     
  7. cgascons

    cgascons

    Joined:
    Feb 22, 2016
    Posts:
    25
    Will do that, thanks
     
    SamOYUnity3D likes this.