---
schema_version: "1"
id: 20f8b0690d2ba1b44b2144ee9459315b535a576ab87dca34c9994c01ed2823ab
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/cordova/getDeviceId.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/getDeviceId.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3d3463ac923520281dd06b7db3b80aef5d3336d05d82ca70d43d0fdc24d1a5a3
products:
  - Salesforce Engagement SDK
---
# getDeviceId

Returns the `deviceId` used by the MobilePush SDK.

## Syntax

`MCCordovaPlugin.getDeviceId(successCallback, [errorCallback])`

## Kind

Static method of `MCCordovaPlugin`.

## Parameters

| Parameter                  | Type       | Description                                  |
| -------------------------- | ---------- | -------------------------------------------- |
| `successCallback`          | `function` |                                              |
| `successCallback.deviceId` | `string`   | The `deviceId` used by Engagement messaging. |
| `errorCallback`            | `function` |                                              |

## See Also

- [Android SDK Reference](https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/javadocs/MarketingCloudSdk/8.0/-marketing%20-cloud%20-s-d-k/com.salesforce.marketingcloud.registration/-registration-manager/get-device-id.html)
- _SDK Reference for iOS_: [deviceIdentifier() Method](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/ios-sdk-v11/mce-sdk/classes/marketingcloudsdk.md#deviceidentifier)
