Get device id

  • Since SDK: 19

Get a unique identifier string for the device the viewer is running on.

adobe.dps.store.getDeviceId

Parameter Type Description
callback

getDeviceIdFunction

Function that will be called with this signature: deviceId where deviceId is the string containing the unique device ID

getDeviceIdFunction

Parameter Type Description
deviceId

string

The unique device identifier.

API Snippet

getDeviceId

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Get Device ID API</title>
<script type="text/javascript">
function getDeviceID()
{
  var deviceID = document.getElementById("device_id").value;
  // call into the getDeviceID API
  adobe.dps.store.getDeviceId(deviceID, function(returnedDeviceId)
    {
      document.write("<p>Device ID: " + returnedDeviceId + "</p>");
    }
  );
}
</script>
</head>

<body>
<p>Get Device ID</p>
<input type="text" id="device_id" width="100" /> 
<button type="button" id="getDeviceId" onclick="getDeviceID()">Get Device ID</button>
</body>
</html>