Class DeviceIdHolder
Used by ObscuredPrefs and ObscuredFile for the device lock feature.
public class DeviceIdHolder
- Inheritance
-
objectDeviceIdHolder
Properties
DeviceId
Allows getting current device ID or setting custom device ID to lock data to the device.
public static string DeviceId { get; set; }
Property Value
- string
Remarks
⚠️ Warning: All data saved with previous device ID will be considered foreign!
Methods
ForceLockToDeviceInit()
Allows forcing device id obtaining on demand. Otherwise, it will be obtained automatically on first usage.
public static void ForceLockToDeviceInit()
Remarks
Device id obtaining process may be noticeably slow when called first time on some devices.
This method allows you to force this process at comfortable time (while splash screen is showing for example).
Call this if you going to use ObscuredFile or ObscuredFilePrefs from non-main thread while using
Lock To Device feature without custom DeviceId to avoid exception due to Unity API access
from non-main thread.