Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Separate sku id for UDP?

Discussion in 'Unity Distribution Portal (UDP)' started by homenetgames-jacek, Jun 2, 2021.

  1. homenetgames-jacek

    homenetgames-jacek

    Joined:
    Jun 8, 2015
    Posts:
    15
    Hello,

    We've got a game published on UDP, it is using old Unity IAP plugin 1.23.5 (it contains UDP).
    In this game we used separate sku id's for UDP (because Huawei doesn't accept underscores since some time) using following initialization (it was working properly):

    Code (CSharp):
    1. string sku = "sku_sampleinapp_01";
    2. string[] stores = new string[] { "UDP" };
    3. IDs ids = new IDs();
    4. ids.Add(sku.Replace("_", ""), stores); // -> skusampleinapp01
    5. builder.AddProduct(sku, ProductType.Consumable, ids);
    Now we've upgraded game to Unity 2020.3, used latest packages (IAP 3.2.1, UDP 2.1.6) and it seems that store ID "UDP" in the code above doesn't work anymore. Unity IAP / Android / target is set to UDP, sandbox login is displayed and "UDP initialization succeeded" popup is visible. But log shows following for all iap's and IAPListener OnInitializeFailed is called with NoProductsAvailable.

    W/Unity (31246): Unavailable product sku_sampleinapp_01-sku_sampleinapp_01
    W/Unity (31246): UnityEngine.Logger:LogFormat(LogType, String, Object[])
    W/Unity (31246): UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
    W/Unity (31246): UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
    W/Unity (31246): UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
    W/Unity (31246): UnityEngine.Purchasing.JSONStore:OnProductsRetrieved(String)
    W/Unity (31246): System.Action`2:Invoke(T1, T2)
    W/Unity (31246): UnityEngine.Purchasing.UDPBindings:OnInventoryQueried(Boolean, Object)
    W/Unity (31246): System.Action`2:Invoke(T1, T2)
    W/Unity (31246): UnityEngine.UDP.UdpIapBridge:OnQueryInventory(Inventory)
    W/Unity (31246): System.Action:Invoke()
    W/Unity (31246): UnityEngine.UDP.MainThreadDispatcher:Update()


    So, is it now possible to define separate sku id's for UDP?

    Thanks,
    Jacek