getDeviceCredentials static method

Future<Object?> getDeviceCredentials()

Implementation

static Future<Object?> getDeviceCredentials() async {
  // Fetch device credentials as list
  List? result = await _channel.invokeMethod<List>('getDeviceCredentials');

  // Return null if device not registered yet
  if (result == null) {
    return result;
  }

  // Convert list to map of {token, authKey}
  return {'token': result[0], 'authKey': result[1]};
}