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. Dismiss Notice

Question Calling this BuyProductID and ios show the purchase page is slow

Discussion in 'Unity IAP' started by nathanlin, Jul 21, 2023.

  1. nathanlin

    nathanlin

    Joined:
    Dec 4, 2021
    Posts:
    31
    why i calling this BuyProductID and ios show the purchase page is slow? it 's more time then other game.
    any ideas?

    Code (CSharp):
    1. void BuyProductID(string productId)
    2.     {
    3.         if (IsInitialized())
    4.         {
    5.             UnityEngine.Purchasing.Product product = m_StoreController.products.WithID(productId);
    6.  
    7.             if (product != null && product.availableToPurchase)
    8.             {
    9.                 MyDebug(string.Format("Purchasing product:" + product.definition.id.ToString()));
    10.                 m_StoreController.InitiatePurchase(product);
    11.             }
    12.             else
    13.             {
    14.                 MyDebug("BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase");
    15.             }
    16.         }
    17.         else
    18.         {
    19.             MyDebug("BuyProductID FAIL. Not initialized.");
    20.         }
    21.     }
     
  2. FMGdev

    FMGdev

    Joined:
    May 5, 2021
    Posts:
    5
    I'm experiencing the same issue when compared to other apps. I suspect the problem is about the number of products initialized which is around 400. But I don't have any clue rather than that.
     
  3. nathanlin

    nathanlin

    Joined:
    Dec 4, 2021
    Posts:
    31
    in testfight or sandbox? normally, the live server should be much quicker.
     
  4. FMGdev

    FMGdev

    Joined:
    May 5, 2021
    Posts:
    5
    It's the same for sandbox, Testflight, and production.