Search Unity

Bug Error in SDK when adding custom data to virtual purchase

Discussion in 'Economy' started by jromin, Dec 15, 2022.

  1. jromin

    jromin

    Joined:
    Nov 25, 2019
    Posts:
    2
    When I add any form of custom data to a virtual purchase item in my config the SDK gives me a parse exception:

    JsonReaderException: Unexpected character encountered while parsing value: {. Path 'customData', line 1, position 159.


    I can have custom data on inventory items but for some reason not on virtual purchases is this a known limitation not mentioned in the docs or a bug? I am using Unity 2021.3.15f1 with economy 3.0.0
     
  2. Laurie-Unity

    Laurie-Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    220
    Hi @jromin

    Thanks for sharing that with us. I have been able to reproduce this issue with Economy 3.1.0. The exception you shared appears to occur when the new
    EconomyService.Instance.Configuration.SyncConfigurationAsync();
    method is called if there are any VirtualPurchases containing Custom Data in the configuration.

    As far as I can see at this point, the only workarounds are likely to be :
    a) remove any Custom Data from virtual purchase objects
    or
    b) revert to one of the v2 Economy SDK packages (although there were some different configurtation / caching issues with those versions)

    I have raised a ticket with the Economy SDK engineering team and will respond here when I have any information or alternate workarounds.

    Apologies for the inconveniemce.
     
    jromin likes this.
  3. jromin

    jromin

    Joined:
    Nov 25, 2019
    Posts:
    2
    Thank you for confirming the bug, I have done a workaround by adding my custom data on the inventory items that the purchase will reward instead not ideal but good enough for now.
     
  4. Nikk_0323

    Nikk_0323

    Joined:
    Apr 29, 2015
    Posts:
    1
    Hey, I was wondering if there are any updates regarding the bug? I am also currently facing the same issue and would like to know if there are any other workarounds except the above mentioned
     
  5. Laurie-Unity

    Laurie-Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    220
    Hi @Nikk_0323

    I'm sorry to hear that you are also running into an issue due to the same bug. We have a fix scheduled to go out with the next Economy package update, we are just waiting for package approval. However, I'm afraid I can't provide an ETA as the package manager approval process is quite rigorous.