Sign In Register

How can we help you today?

Start a new topic
Solved

Game Spark don't use unsupportedIdentifier for Unity SDK

I've just found the code in PlatformBase.cs. This code could potentially lead to the bugs. And do not correct return device id for WebGL. See code below

   

            if (Application.platform == RuntimePlatform.PS4 || Application.platform == RuntimePlatform.XboxOne)
            {
#if GS_DONT_USE_PLAYER_PREFS || UNITY_SWITCH
                DeviceId = SystemInfo.deviceUniqueIdentifier.ToString();
#else
                DeviceId = PlayerPrefs.GetString(PLAYER_PREF_DEVICEID_KEY);
                if (DeviceId.Equals(""))
                {
                    DeviceId = System.Guid.NewGuid().ToString();

                    PlayerPrefs.SetString(PLAYER_PREF_DEVICEID_KEY, DeviceId);
                    PlayerPrefs.Save();
                }
#endif
            }
            else
            {
                DeviceId = SystemInfo.deviceUniqueIdentifier.ToString(); //BUG IS HERE
            }

   This code should be replaced to recommended Unity flow for checking the device id with unsupportedIdentifier property. 


https://docs.unity3d.com/ScriptReference/SystemInfo-unsupportedIdentifier.html


And also this code will not works for WebGL because: 

https://issuetracker.unity3d.com/issues/systeminfo-dot-deviceuniqueidentifier-for-webgl-returns-n-slash-a


Hello Sergii,

Thank you for reporting this issue, I will give a look at it very soon.


Giuseppe

However, that code above should not affect WebGL, because it is auto-generated as a normal GUID on this platform.


Giuseppe

Ah ok, I've found this place. Thanks. 

Login to post a comment