Search Unity

IAP Manager : error when the user doesnt have any credit card registered on his phone

Discussion in 'Unity IAP' started by Agooloo-Studios, Mar 30, 2020.

  1. Agooloo-Studios

    Agooloo-Studios

    Joined:
    Jun 26, 2015
    Posts:
    5
    Hi fellows,

    I'm Julien from France and I've an issue for few months with the IAP manager. Some of my players cant launch the game because they got an error during the IAP Manager initialization : "Purchasing Unavailable". It seems that all the players who dont have registered a valid credit card on their Android account get that error.

    Some of you know how to handle this guys?

    Thank you very much for. your help Unity bros!

    Julien
     
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Maybe you can prompt the user to check the settings after receiving this error message.
     
  3. Agooloo-Studios

    Agooloo-Studios

    Joined:
    Jun 26, 2015
    Posts:
    5
    Hi,

    Thank for your answer. I must confess, I dont really got it.. ;-)

    I dont think I'm the only to have this problem. I think everybody's has to deal with that.
    What is the best practice? This case is not handled by the IAP Manager itself?
     
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Understand what you are saying. To make a purchase on Google Play, Unity IAP uses Google Play Billing. When Unity IAP gets a "Purchasing Unavailable" response from Google Play Billing, we can only pass it to the developer, which requires the developer to handle it.
    https://developer.android.com/reference/com/android/billingclient/api/BillingClient.BillingResponse
     
  5. Agooloo-Studios

    Agooloo-Studios

    Joined:
    Jun 26, 2015
    Posts:
    5
    Thank you for your answer Sam.

    I dont see any "Purchasing Unavailable" in the URL you gave me, and I dont see any response which is related to my case. Could you help me about this please?

    Thank you very much,

    Julien
     
  6. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Hi Julien. I think maybe the game logic should be modified. Even if IAP is not successfully initialized, it should not affect the user to launch the game. What do you think?

    In addition, when the IAP initialization fails, the Initialization Failure Reason will be returned in IStoreListener.OnInitializeFailed. You can remind the user to check the settings here.
    Code (CSharp):
    1.  public void OnInitializeFailed(InitializationFailureReason error)
    2.     {
    3.         //Debug.Log("****************OnInitializeFailed, error:" + error);
    4.         switch (error)
    5.         {
    6.             case InitializationFailureReason.AppNotKnown:
    7.                 break;
    8.             case InitializationFailureReason.NoProductsAvailable:
    9.                 break;
    10.             case InitializationFailureReason.PurchasingUnavailable:
    11.                 break;
    12.             default:
    13.                 break;
    14.         }
    15.     }
     
  7. Agooloo-Studios

    Agooloo-Studios

    Joined:
    Jun 26, 2015
    Posts:
    5
    Thanks man!
     
    SamOYUnity3D likes this.