Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Can't download price from Google Console metadata using Codeless IAP

Discussion in 'Unity IAP' started by hottabych, Jan 5, 2018.

  1. hottabych

    hottabych

    Joined:
    Apr 18, 2015
    Posts:
    74
    You said "provide either a price or an ID"
    But when I create a new product, it is already "price = 0", and I can only change it and cannot delete at all.
    upload_2018-1-5_18-3-26.png
    Because of it, it always written 4.99 on the button, even if I change the price in the Console.
    If I do not use Visual IAP Catalog and create purchases using code like
    buyButton.text = product.metadata.localizedPriceString , it works okay.
    Is it a Unity bug?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    Sorry, I don't quite follow. Didn't you change it from 0 to 4.99? I just tested here on Unity 2017.3, and I can easily change the price in that field. Perhaps what I'm missing is your mention "change the price in the Console". The Console simply displays program output, can you elaborate? Edit - I see that you probably meant the Google Console and not the Unity Console. Keep in mind that you are setting an override for the Google price, so this would be expected behavior.
     
    Last edited: Jan 5, 2018
  3. hottabych

    hottabych

    Joined:
    Apr 18, 2015
    Posts:
    74
    Yes, I meant Google Console (Developer Panel).
    The problem is that I quote the price in Google, but when I launch the game, the price in the store is still used from the local "Price" field (highlighted in the screenshot), and this field can not be cleared.
    Today I even tried to change platform to iOS -- it still uses price from this field despite it related to Google Configuration!
     
    Last edited: Jan 16, 2018
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    So that price that you have circled in Red in the screenshot is a static text field for you, and cannot be edited? Did you originally place the 4.99 value in there, but now you cannot change it?
     
  5. hottabych

    hottabych

    Joined:
    Apr 18, 2015
    Posts:
    74
    No, I can change this input field, but I cannot clear it! So it prevents fetching the price from Google Dev Console.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    @hottabych Apologies, I see what you mean, and is what you originally described. Sorry about that, I am seeing the same thing. I am checking with the IAP team now, and I will keep you updated
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    @hottabych I met with the IAP team today, and they plan to address this issue in a future release. Thank you for the heads up, and apologies on the inconvenience. As a workaround, make a back up of your project first, then delete the Assets/UnityPurchasing and Assets/UnityChannel folders, and reimport IAP. This should rebuild your product catalog to the default settings.
     
    hottabych likes this.
  8. hottabych

    hottabych

    Joined:
    Apr 18, 2015
    Posts:
    74
    There's new version of IAP, but this issue is still not fixed :(
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    Are you able to move forward with the mentioned workaround in the meantime?
     
  10. hottabych

    hottabych

    Joined:
    Apr 18, 2015
    Posts:
    74
    No.
    I deleted those folders and reimported IAP package. The problem persists.
    upload_2018-4-14_8-8-39.png
    When I create a new Product in catalog, it's already "Price: 0". And it prevents fetching the price metadata from Google Console or from App Store Developer Panel.
     
  11. hottabych

    hottabych

    Joined:
    Apr 18, 2015
    Posts:
    74
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    In discussing with the IAP team, this issue should be addressed in the next IAP release, currently scheduled for mid-September.
     
    hottabych likes this.
  13. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    109
    Hi,

    I have a similar question. I put my price as: 0 and want to use the price from the "Price Template", which I hope I can display the product price download from the Google Play Console using "productCatalogItem.metadata.localizedPriceString".

    At the moment productCatalogItem.metadata.localizedPriceString return 0 which is what I have on under"Price" field.
     

    Attached Files:

  14. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    @hottabych @Gamrek I want to confirm that you are testing this behavior on an actual device, and not in the Editor. Can you confirm?
     
  15. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    109
    @JeffDUnity3D Hi I was only testing it with my editor. I have not tested it on actual device yet.
     
  16. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    Prices are not downloaded from Google in the Editor, only on a device.
     
  17. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    519
    For me editing the generated .csv file worked

    • set the price to 0
    upload_2018-9-26_17-29-21.png

    • after the export to .csv, edit "auto fill prices" to false.
    upload_2018-9-26_17-28-57.png
    • When exporting from the google-developer also yields false for pricing template entries
    • "Pricing Template ID" is the number you can see in you Google Console/Settings/Pricing Templates, it wont accepts the name
    • beware that if your csv editing application might make the file incompatible, you will get this error then
    "The CSV columns need to be 'Product ID,Published State,Purchase Type,Auto Translate,Locale; Title; Description,Auto Fill Prices,Price,Pricing Template ID'."​


    hope it solves that for you
     
  18. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    @Marrt How does downloading and editing a file affect the behavior when running a game in the Unity Editor?
     
  19. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    519
    Worded it badly, it doesn't. i was taking about the error when you edit the .csv before uploading it to the Google Play Console:
    upload_2018-9-26_19-44-24.png


    However, suddenly i got a different problem in Unity IAP-Catalog, i can't export a .csv anymore
    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Purchasing.ProductCatalogEditor+ProductCatalogExportWindow.ExportHelper (IProductCatalogExporter exporter, System.String path)
    UnityEditor.Purchasing.ProductCatalogEditor+ProductCatalogExportWindow.Export (IProductCatalogExporter exporter)
    UnityEditor.Purchasing.ProductCatalogEditor+ProductCatalogExportWindow.OnGUI (Rect rect)
    UnityEditor.PopupWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/PopupWindow.cs:92)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
    UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:104)
    UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:216)
     
    Last edited: Sep 26, 2018
  20. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    Please try on a new project (easiest probably). What version of Unity and IAP? What's changed since you did it last time?
     
  21. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    519
    AFAIR The only thing i did was copying this number from browser into the "Pricing Template" Field, but i could be wrong, maybe i deleted one or two entries before that
    upload_2018-9-26_21-0-44.png

    Edit: Sorry, forgot the version, had a long day :D
    Unity Version 2018.2.9f1, IAP 1.21

    Anyway, i added all entries manually now so i don't need to export them anymore, so i wont go after that issue anymore
     
    Last edited: Sep 26, 2018
  22. LiLyDarcy

    LiLyDarcy

    Joined:
    Oct 10, 2018
    Posts:
    6
    why????
    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Purchasing.ProductCatalogEditor+ProductCatalogExportWindow.ExportHelper (IProductCatalogExporter exporter, System.String path)
    UnityEditor.Purchasing.ProductCatalogEditor+ProductCatalogExportWindow.Export (IProductCatalogExporter exporter)
     
  23. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
    @LiLyDarcy Is this a new issue that you are reporting? If so, please open a new thread. Be sure to provide steps to reproduce.