getCurrentDeviceInfo method

Future<NearbyDeviceInfo?> getCurrentDeviceInfo()

Getting info about the current device in P2P scope.

This method can be used to define the name of the current device to be displayed on the network to other users.

Also NearbyDeviceInfo contains the connection ID. Note that the ID obtained from getCurrentDeviceInfo for Android will always be 02:00:00:00:00:00 for privacy issues. For iOS, it can be safely used.

Implementation

Future<NearbyDeviceInfo?> getCurrentDeviceInfo() {
  return NearbyServicePlatform.instance.getCurrentDeviceInfo();
}