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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved Unavailable product for Google Subscriptions

Discussion in 'Unity IAP' started by Edmund-Dev, Jun 21, 2022.

Thread Status:
Not open for further replies.
  1. Edmund-Dev

    Edmund-Dev

    Joined:
    Oct 15, 2019
    Posts:
    9
    Hi, I've just tested the Sample v3 IAP project from the forum for Android Platform:
    https://forum.unity.com/threads/sample-iap-project.529555/

    Unity Editor 2020.3.33f1
    Unity In-App Purchasing 4.1.3
    Testing Device: Android Samsung S21 FE
    Application APK: Downloaded from Play Store

    I've also setup the following:
    • Google IAP Product id: gold50
    • Prepaid 1 month duration subscription id: sub_monthly
    • Prepaid 1 year duration subscription id: sub_yearly
    • Licensed Testing account + Licence response as "LICENSED" in Google Play Console

    Without any modifications to any code (simple build, upload and deploy to internal track), I've encountered an issue where the Google Subscriptions products are not able to initialize. After pressing the "Initialize" button, only gold50 as a product work and I'm able to see the test payment for test card screen. However pressing the subscription button returns the following:

    BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase

    This is the adb logs for the test.
    Am I doing something wrong for subscriptions or does Unity IAP not support it due to Google's new changes in May 2022?

    Edit: Tested on Unity In-App Purchasing 4.1.5 and having the same issue as stated above.
     
    Last edited: Jun 21, 2022
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Subscriptions continue to work just fine. Sometimes it takes Google a day or so for the products to finally be available for sale. Please show your AddProduct code for the subscription, and a screenshot of your product as listed on the Google dashboard (to confirm the productID spelling)
     
  3. Edmund-Dev

    Edmund-Dev

    Joined:
    Oct 15, 2019
    Posts:
    9
    In-app products:


    Subscription:

    Variables:
    Code (CSharp):
    1. public static string GOLD_50 = "gold50";
    2. public static string MONTHLY = "sub_monthly";
    3. public static string YEARLY = "sub_yearly";
    Initialize button:
    Code (CSharp):
    1.  
    2. public void MyInitialize()
    3.     {
    4.         InitializePurchasing();
    5.     }
    6.  
    7.  public void InitializePurchasing()
    8.     {
    9.         if (IsInitialized())
    10.         {
    11.             return;
    12.         }
    13.        
    14.         builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    15.  
    16.         builder.AddProduct(GOLD_50, ProductType.Consumable);
    17.         builder.AddProduct(MONTHLY, ProductType.Subscription);
    18.         builder.AddProduct(YEARLY, ProductType.Subscription);
    19.  
    20.         builder.Configure<IGooglePlayConfiguration>().SetObfuscatedAccountId("test1");
    21.  
    22.         builder.Configure<IGooglePlayConfiguration>().SetDeferredPurchaseListener(OnDeferredPurchase);
    23.  
    24.         MyDebug("Starting Initialized...");
    25.         UnityPurchasing.Initialize(this, builder);
    26.  
    27.         //ProductCatalog catalog = ProductCatalog.LoadDefaultCatalog();
    28.  
    29.         //foreach (ProductCatalogItem product in catalog.allProducts)
    30.         // {
    31.         //MyDebug("Product = " + product.id);
    32.         //}
    33.     }
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    @Edmund-Dev Looks correct! I will test with a new subscription later today, ensure yours says Active
     

    Attached Files:

    • Sub1.png
      Sub1.png
      File size:
      53.8 KB
      Views:
      200
  5. Edmund-Dev

    Edmund-Dev

    Joined:
    Oct 15, 2019
    Posts:
    9
    Understood, thank you for looking into this.

     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    @Edmund-Dev I just tested by creating a new subscription. It worked as expected for me. You are correct, there have been many changes on the Google dashboard when creating a subscription with base plans, offers, etc! But I filled it all out, and a test purchase succeeded on the first try about 5 minutes after creating the new subscription product. I'm using closed testing, and I'm able to side load directly to my Samsung phone using "adb install" via USB. I'm using v3 of the Sample Project also. I set my country to US only on the Google dashboard for IAP purchases and set the price accordingly.
     
  7. Edmund-Dev

    Edmund-Dev

    Joined:
    Oct 15, 2019
    Posts:
    9
    I've promoted the internal test to closed testing while setting the country to Singapore only, however I still have the same issue when clicking on the subscription button :
    BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase


    Is there any other possible issues that could prevent subscriptions from being added?
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Your screenshot shows 173 countries, not 1. Did you fill out the pricing for all countries? You might try the same test as I did, with US only. Are you located in Singapore? The message in your screenshot also mentions offers are not supported with pre-paid base plans, I did not use that option. I used auto-renewing. Did you include a free trial? You might try publishing a new version to test, and download via Google Play as a tester.
     
  9. Edmund-Dev

    Edmund-Dev

    Joined:
    Oct 15, 2019
    Posts:
    9
    I've updated the base plan for both subscription base plan to auto-renewing and after waiting a few hours it managed to successfully add the product into the IAP builder. Both monthly and yearly now works as intended with the test card payment screen for Closed Testing & Internal Test track.

    Does it mean that Unity IAP 4.x at the moment does not support prepaid subscription types for Google which causes the product to not be added?
     
    Last edited: Jun 23, 2022
    duongpq likes this.
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    We would need to test. We do plan to ensure these options are fully available as we move to Google Billing Library v5 later this year.
     
  11. Francesco-FL

    Francesco-FL

    Joined:
    May 25, 2021
    Posts:
    176
    Same thing.

    For two days I was I did many tests and checked many times. I had a subscription with no automatic renewal and I had done everything correctly but still could not find the product in the initialization.

    Then I found this thread, I changed the subscription to an auto-renewing one and after an hour it works.

    Maybe it would be better for Unity to write it down somewhere that non-auto-renewing subscriptions aren't supported (if so), or others will end up wasting a lot of time.
     
    duongpq likes this.
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    We will be addressing this issue when we update to the latest Google Play Billing Library in the coming months.
     
    Francesco-FL likes this.
  13. RMGK

    RMGK

    Joined:
    Sep 30, 2011
    Posts:
    75
    What's the features does Unity not support? I am still battling with this. Is free trial / grace period supported?
    Also, is there an update on support?
    Many thanks
     
  14. RMGK

    RMGK

    Joined:
    Sep 30, 2011
    Posts:
    75
    For my issue, I was getting confused between the base plan subscription ID and the product subscription ID. All working now. Unity 2021, IAP 4.5.0
     
  15. psrar

    psrar

    Joined:
    Mar 24, 2020
    Posts:
    1
    Hello. Did you set base plan ID or subscription product ID?
     
  16. james580

    james580

    Joined:
    Aug 9, 2017
    Posts:
    19
    I'm having the same question. What's the difference between the subscription product id and the base plan id? Seems like it should be such a simple answer but I can't find any clear info, and there are no examples in the documentation.
     
  17. james580

    james580

    Joined:
    Aug 9, 2017
    Posts:
    19
    I'm not positive yet, but it seems like it might be like this:

    If I'm creating 2 subscriptions for both iOS and Google Play:
    • "appname.premium.monthly" and
    • "appname.premium.yearly"

    Would it look like this in Google Play:
    • subscription product id: "appname.premium."
    • base plan ids: "monthly" and "yearly" ?
     
    Last edited: Dec 19, 2022
  18. Yannick_D

    Yannick_D

    Unity Technologies

    Joined:
    Feb 21, 2022
    Posts:
    218
    Hello,

    Subscription base plans will be supported with Google Billing v5, but for now, I would suggest creating 2 different subscriptions on GooglePlay:
    "appname.premium.monthly" and "appname.premium.yearly"


    It's the subscription product id that must match the product id that Unity IAP knows. If you choose to use a different name, you must fill the store specific id so Unity IAP can match it to the subscription product id of the store.

    This might provide more information:
    https://docs.unity3d.com/2022.2/Documentation/Manual/UnityIAPDefiningProducts.html
     
    james580 likes this.
  19. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    172
    This thread is now closed. Feel free to reach out via a new thread if you encounter further issues.
    Thanks!
     
Thread Status:
Not open for further replies.