getDeviceKey method

Future<String?> getDeviceKey()

Returns the cached key for this device. Device keys are stored in local storage and are used to track devices. Returns null if no device key was cached.

Implementation

Future<String?> getDeviceKey() async {
  // Return device key if it has been loaded or updated
  if (_deviceKey != null) {
    return _deviceKey;
  }
  // Otherwise, load from local storage
  await getCachedDeviceKeyAndPassword();
  return _deviceKey;
}