Skip to content

DeviceInfoService

Provides static hardware and operating system information about this phone.

A singleton, accessed as DeviceInfoService(). Call init once (done by SmartPhoneClientManager.configure); after that the fields are set. Used e.g. to create the Smartphone device registration and by DeviceProbe.

It takes different hardware information from Android and iOS:

Constructors

DeviceInfoService

DeviceInfoService()

Properties

deviceData

Map<String, dynamic> deviceData
getter/setter pair

The full device info for this device. See BaseDeviceInfo.data.

deviceID

String? deviceID
getter/setter pair

Device ID.

  • Android - The build ID: either a changelist number, or a label like "M4-rc20". Note that this is not unique per device.
  • iOS - Unique UUID value identifying the current device.

deviceManufacturer

String? deviceManufacturer
getter/setter pair

The manufacturer of the device.

  • Android - The manufacturer of the product/hardware.
  • iOS - always "Apple".

deviceModel

String? deviceModel
getter/setter pair

Device model.

  • Android - The end-user-visible name for the end product.
  • iOS - Device model according to OS.

deviceName

String? deviceName
getter/setter pair

Device name.

  • Android - The name of the industrial design.
  • iOS < 16 user-assigned device name.
  • iOS >= 16 a generic device name if project has no entitlement to get user-assigned device name.

On iOS, see more about device name.

hardware

String? hardware
getter/setter pair

The name of the hardware.

  • Android - the name of the hardware (from the kernel command line or /proc).
  • iOS - hardware type (e.g. 'iPhone7,1' for iPhone 6 Plus).

initialized

bool get initialized

Has the device info been initialized?

operatingSystemName

String? operatingSystemName
getter/setter pair

The name of the current operating system. On Android this is the version codename (e.g. REL).

operatingSystemVersion

String? operatingSystemVersion
getter/setter pair

The current operating system version. On Android this is the base OS build.

platform

String? platform
getter/setter pair

The platform, Android or iOS. null until init has run.

release

String? release
getter/setter pair

Release level. The user-visible version on Android (e.g. 14), the kernel version on iOS.

sdk

String? sdk
getter/setter pair

SDK level. The SDK int on Android, the kernel release on iOS.

Methods

init

Future<void> init()

Reads the device info using the DeviceInfoPlugin.

Does nothing if already initialized. On failure, deviceData stays empty and the other fields stay null.

toString

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.