Search Unity

IAP 1.22 Unity 2019 Issue

Discussion in 'Unity IAP' started by justtime, Oct 16, 2019.

  1. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    Hi there! Many users of my app(Android) complain, that after initial purchasing, pro features work well, but after new run they are gone. On my test phones Nexus 5, Pixel 3a, and Lenovo tablet everything works fine. Also, in my crashalytics i can see a few Purchase Initializations failures, but not so much. Can you give me advice what should i check? Or may be somebody have faced with this problem already?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you elaborate as to what you mean by Pro features? What is the specific behavior that your users are describing.
     
  3. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    I mean i have some paid features, which enabled on "pro" item purchase. I save state of this item locally, and also, when user connected to internet, on IAP init, i check, that this one is active and then enable/disable pro features.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    How do you check? Please show your code. Also please provide the device logs if possible. Without the logs or steps to reproduce, there is unfortunately not much we can do. We do have a new IAP release coming out today, or very soon.
     
  5. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    I've sent PM with my sources.
    BTW, can i remove UnityChannel and UDP folders, if i want use IAP only with Google Play and App Store?
    Also, could you clarify why we have so many sources of IAP: Package manager, asset store, services window? It's very confusing.


    Here
    Code (CSharp):
    1. public void OnInitializeFailed(InitializationFailureReason error)
    2.     {
    3.         _initStarted = false;
    4.         Debug.LogWarning("!!! OnInitializeFailed Billing failed to initialize!");
    5.  
    6.         switch (error)
    7.         {
    8.             case InitializationFailureReason.AppNotKnown:
    9.                 //if (Debug.isDebugBuild)
    10.                 Debug.LogWarning("Is your App correctly uploaded on the relevant publisher console?");
    11.                 ToastManager.Show(LocalizationManager.GetTranslation("Messages/Purchase_init_failed") + " AppNotKnown");
    12.                 MyCrashlytics.Instance.LogNonFatal(new Exception($"Purchaser OnInitializeFailed error"), $"error = AppNotKnown", true);
    13.  
    14.                 break;
    15.             case InitializationFailureReason.PurchasingUnavailable:
    16.                 // Ask the user if billing is disabled in device settings.
    17.                 //if (Debug.isDebugBuild)
    18.                 Debug.LogWarning("Billing disabled!");
    19.                 ToastManager.Show(LocalizationManager.GetTranslation("Messages/Purchase_init_failed") + " PurchasingUnavailable");
    20.                 MyCrashlytics.Instance.LogNonFatal(new Exception($"Purchaser OnInitializeFailed error"), $"error = PurchasingUnavailable", true);
    21.  
    22.                 break;
    23.             case InitializationFailureReason.NoProductsAvailable:
    24.                 // Developer configuration error; check product metadata.
    25.                 //if (Debug.isDebugBuild)
    26.                 Debug.LogWarning("No products available for purchase!");
    27.                 ToastManager.Show(LocalizationManager.GetTranslation("Messages/Purchase_init_failed") + " NoProductsAvailable");
    28.                 MyCrashlytics.Instance.LogNonFatal(new Exception($"Purchaser OnInitializeFailed error"), $"error = NoProductsAvailable", true);
    29.  
    30.                 break;
    31.         }
    32.     }
    i got a lot of "PurchasingUnavailable" errors
     
    Last edited: Oct 17, 2019
    Livealot likes this.
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Does it work in your testing? We would need specific steps to reproduce, or at least the device logs, in order to start the troubleshooting process.