Search Unity

Unity Dashboard Analytics -> Remote Settings is bugged? (No long data type)

Discussion in 'Unity Analytics' started by xVergilx, Dec 19, 2018.

  1. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    1,330
    There's RemoteSettings.GetLong in scripting API, but no long data type in Add Key-Value pair dialog on the analytics web page.

    Is that intended?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,670
    @VergilUa I will check. Does it still work for you if you create a numeric string ("123")?
     
  3. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    1,330
    I haven't tried that.

    My main point is that parameter set in web console is automatically checked by the web page script, meaning it's not possible to set integer as long (due to digit limit);
    And the actual long type is missing from the selection.

    I'm pretty sure it's possible to set parameter as string, and then convert the string to the long in game, but I'd rather avoid it if it's already performed by a specific method on it's own.
    (Plus it may confuse non-tech staff on why it's set as string)
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,670
    I meant, simply set it as a string in the Dashboard, and GetLong should then be expected to work.
     
    xVergilx likes this.
  5. monry

    monry

    Joined:
    Jun 7, 2013
    Posts:
    4
    I'm having same issue.

    1. I setup long value as string.
    upload_2019-1-9_14-46-29.png
    2. I wrote test code as below

    Code (CSharp):
    1. Assert.AreEqual(10L, UnityEngine.RemoteSettings.GetLong("LongValue"));
    Of cource, these tests are run as PlayMode tests.

    3. But it returns fail.

    Code (csharp):
    1. ---
    2. Expected: 10
    3.   But was:  0
    4. ---
    Is something wrong?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,670
    @monry Are your other tests passing for Remote Settings? That is, are you able to get the other data types?
     
  7. monry

    monry

    Joined:
    Jun 7, 2013
    Posts:
    4
    @JeffDUnity3D
    Yes, I can get the other data types.
    For example, the following test has passed.

    Code (CSharp):
    1. Assert.AreEqual("value", UnityEngine.RemoteSettings.GetString("StringValue"));
    2.  
    upload_2019-1-9_19-10-24.png
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,670
    I will let the Analytics team know.
     
    monry likes this.
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,670
    We currently don't provide the Long datatype as described in the documentation. If you need such a long value, you could instead save and retrieve it as a String and convert it on the client, otherwise you would want to use Integer type. We are discussing why the GetLong method was implemented, it may be removed.
     
    monry likes this.
  10. monry

    monry

    Joined:
    Jun 7, 2013
    Posts:
    4
    @JeffDUnity3D
    Thank you for your answer !
    I'll remove the code that using `GetLong` method.
    I'll convert `string` to `long`, if I need to use value as `long`.