getDeviceId

Retrieves the unique device identifier.

Syntax 

1Future<String?> getDeviceId()

Returns 

  • Future<String?> - Returns the device ID as a string, or null if no device ID is available.

Example 

1String? deviceId = await SfmcSdk.getDeviceId();
2if (deviceId != null) {
3  print('Device ID: $deviceId');
4} else {
5  print('No device ID available');
6}

Notes 

  • The device ID is used internally by the SDK to identify the device.
  • This ID may be different from the system push token.