---
schema_version: "1"
id: b3619246fdc8342d0f548ec597f0d9bbcc83bd36b58e0d2806c3715d5595f9ad
title: getDeviceId
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud-mobilepush/engagement_sdk/references/flutter/flutter_getDeviceId.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/flutter_getDeviceId.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: cf86f892803ce6871f67569238ce2c37323df06b7ed7daf28034f138c947fade
products:
  - Salesforce Engagement SDK
---
# getDeviceId

Retrieves the unique device identifier.

## Syntax

```dart
Future<String?> getDeviceId()
```

## Returns

- `Future<String?>` - Returns the device ID as a string, or `null` if no device ID is available.

## Example

```dart
String? deviceId = await SfmcSdk.getDeviceId();
if (deviceId != null) {
  print('Device ID: $deviceId');
} else {
  print('No device ID available');
}
```

## Notes

- The device ID is used internally by the SDK to identify the device.
- This ID may be different from the system push token.
