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 In-App purchase works on testflight but not on release

Discussion in 'Unity IAP' started by helloroy, Sep 22, 2023.

  1. helloroy

    helloroy

    Joined:
    Jun 23, 2016
    Posts:
    42
    Hello,

    When I using Unity 2022.3.6f1 and com.unity.purchasing 4.9.3, everything is working, but when I update the Unity to 2022.3.8f1 many iPhone users reported that the IAP was paid but did not receive any product.

    So I tested it on testflight, and the IAP is working fine, but when I tested released App on App Store, the payment was complete, but seems the game haven't handling the product action.

    My product is set by code using InitializePurchasing


    Code (CSharp):
    1.  
    2.     void Start()
    3.     {
    4.         // If we haven't set up the Unity Purchasing reference
    5.         if (m_StoreController == null)
    6.         {
    7.             // Begin to configure our connection to Purchasing
    8.             InitializePurchasing();
    9.         }
    10.     }
    11.  
    12.     public void InitializePurchasing()
    13.     {
    14.         // If we have already connected to Purchasing ...
    15.         if (IsInitialized())
    16.         {
    17.             // ... we are done here.
    18.             return;
    19.         }
    20.  
    21.         //set product
    22.         products.Add("product_name", new MyProduct()
    23.         {
    24.             type = ProductType.Consumable,
    25.             action = () =>
    26.             {
    27.                 //add product
    28.             }
    29.         });
    30.  
    31.         // Create a builder, first passing in a suite of Unity provided stores.
    32.         var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    33.  
    34.         // Add a product to sell / restore by way of its identifier, associating the general identifier
    35.         // with its store-specific identifiers.
    36.         foreach (KeyValuePair<string, MyProduct> kvp in products)
    37.         {
    38.             builder.AddProduct(kvp.Key, kvp.Value.type);
    39.         }
    40.  
    41.         // Kick off the remainder of the set-up with an asynchrounous call, passing the configuration
    42.         // and this class' instance. Expect a response either in OnInitialized or OnInitializeFailed.
    43.         UnityPurchasing.Initialize(this, builder);
    44.     }
    45.  
    46.  
    Any one have the same issue? and any Idea to fix it?

    Thanks
     
  2. unity_320AC700C5AB25D195F1

    unity_320AC700C5AB25D195F1

    Joined:
    Nov 19, 2021
    Posts:
    15
    I assume you're running into the issue documented here; i.e. upgrade to IAP package 4.9.4.
     
    helloroy likes this.
  3. game_unity01

    game_unity01

    Joined:
    Apr 25, 2023
    Posts:
    2
    Thank you.
    I tried IAP package 4.9.4 (remove->install), but it is not work for me.
     
  4. helloroy

    helloroy

    Joined:
    Jun 23, 2016
    Posts:
    42
    The problem is come from the CrossPlatformValidator and throw IAPSecurityException, seems similar as your issue, I will try to update to 4.9.4 and update the result here.

    Thanks