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

Unity IAP NoProductsAvailable

Discussion in 'Unity IAP' started by kimsin4004, Mar 5, 2021.

Thread Status:
Not open for further replies.
  1. kimsin4004

    kimsin4004

    Joined:
    Apr 12, 2020
    Posts:
    10
    Hi I'm trying unity IAP in my project.
    In editor purchasing item works, but not in android.

    I did following things.

    1. Installed IAP package

    2. Set up catalog
    upload_2021-3-5_23-6-35.png

    3. made in app purchase product in google play console, and its status is available. (Sorry for that ui language is not English)
    upload_2021-3-5_23-7-42.png

    4. Started Alpha Test and it's available.
    upload_2021-3-5_23-7-14.png

    5. Added my email to tester list and the email is on "License Test" list too.(I added my developer account email and another email too)

    6. I tested with email that is not developer email.

    My adb log is show this.
    upload_2021-3-5_23-8-43.png

    My code is like this.
    Code (CSharp):
    1.  
    2. void Awake()
    3.     {
    4.         if (_storeController == null)
    5.         {
    6.             _productInfoList = new ProductInfo[] {
    7.                 new ProductInfo { ID = "cb_100", Value = 100 }
    8.             };
    9.             InitStore();
    10.         }
    11.     }
    12.  
    13.     void InitStore()
    14.     {
    15.         ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    16.         foreach(var info in _productInfoList)
    17.         {
    18.             builder.AddProduct(info.ID, ProductType.Consumable);
    19.         }
    20.  
    21.         UnityPurchasing.Initialize(this, builder);
    22.     }
    23. void IStoreListener.OnInitialized(IStoreController controller, IExtensionProvider extensions)
    24.     {
    25.         _storeController = controller;
    26.         Debug.Log("IAP Intialize Success");
    27.         foreach (var product in _storeController.products.all)
    28.         {
    29.             if (product.availableToPurchase)
    30.                 Debug.Log("AvailableProduct : " + product.definition.id);
    31.         }
    32.     }
    33.  
    34.     void IStoreListener.OnInitializeFailed(InitializationFailureReason error)
    35.     {
    36.         Debug.Log("OnInitializeFailed : " + error);
    37.         foreach(var product in _storeController.products.all)
    38.         {
    39.             if(product.availableToPurchase)
    40.                 Debug.Log("AvailableProduct : " + product.definition.id);
    41.         }
    42.     }
    43.  
    44.  
    Is there anything I missed?
    Thanks.
     

    Attached Files:

    Last edited: Mar 5, 2021
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you translate please? I'm not sure if cb_100 should be in the same character set, but I do know that the productIDs need to match exactly
     
  3. kimsin4004

    kimsin4004

    Joined:
    Apr 12, 2020
    Posts:
    10
    Which part do you need translation for?

    If you mean ui language,

    This means
    product id : cb_100
    price : 1200 KRW
    last update : 2021.3.4
    status : active


    This means "(check mark) version:20(1.0.12) - last update : 2021.3.5"
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    How did you enter the product in the dashboard, did you use Korean? Or did you enter "cb_100" on an English keyboard
     
  5. kimsin4004

    kimsin4004

    Joined:
    Apr 12, 2020
    Posts:
    10
    In English keyboard. There's no 'c' and 'b' character in Korean keyboard of course.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
  7. kimsin4004

    kimsin4004

    Joined:
    Apr 12, 2020
    Posts:
    10
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    What device are you testing on? It could be network issues in your locale. Perhaps try with a different network like your phone data plan, or on a VPN.
     
  9. kimsin4004

    kimsin4004

    Joined:
    Apr 12, 2020
    Posts:
    10
    I used my “samsung galaxy tab A 10.1”and it’s online through home wifi. Is there android sdk minimum limitation to use unity iap?
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Send me a private message, and I'll test here too. I'm in USA
     
  11. kimsin4004

    kimsin4004

    Joined:
    Apr 12, 2020
    Posts:
    10
    Thanks but how can i send message?
     
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Click on my profile photo, and select Start a Conversation
     
  13. kimsin4004

    kimsin4004

    Joined:
    Apr 12, 2020
    Posts:
    10
    I found solution!

    This was because I checked automatic initialize(It's checked as default) in IAP catalog, and initialized UnityPurchase in code too.

    This is described in document like this but easily ignorable(Maybe just for me :)).
    upload_2021-3-11_12-24-48.png
     
  14. kimsin4004

    kimsin4004

    Joined:
    Apr 12, 2020
    Posts:
    10
    And you should not use any IAP related code with CodelessIAP components like IAPListener, IAPButton.
    Use CodelessIAP or CodeOnlyIAP. There's no middle as I see..

    If you use CodeOnlyIAP then buy product with IStorecontroller.InitiatePurchase not with IAPButton.
     
Thread Status:
Not open for further replies.