Device Unique ID
Service URI - luna://com.webos.service.sm
Provides app security and authentication services such as app signature verification. From webOS 3.0 or later platform device, you can use this security manager service for device identification/authentication API.
Methods
| Method | Description | Supported in emulator |
|---|---|---|
Returns device IDs that are provided by webOS TV | No |
deviceid/getIDs
Description
This API returns the device ID provided by the webOS TV. Currently, "LGUDID" (LG Unique Device ID) is supported.
"LGUDID" is generated using MAC as a seed, but it also uses the randomly generated UUID (Universally Unique ID). "LGUDID" is generated according to the UUID version 5 spec and uses MAC as a name and randomly generated UUID (version 4) instead of a namespace ID.
Before you use this API, you must get the user's agreement for using their personal information.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
idType | Yes | String array | Array of ID types. Currently, "LGUDID" is allowed.
|
Call returns
| Name | Required | Type | Description |
|---|---|---|---|
Yes | Object array | Array of device ID data (`idType` and `idValue`) |
Error code reference
Error code | Error code text | Error code description |
|---|---|---|
ERR.001 | Invalid Parameters | Invalid parameter |
ERR.002 | Security Manager Internal Error | Security manager internal error |
ERR.801 | Unsupported Device ID Type | Unsupported device ID type is given for `deviceid/getIDs` API |
Example
// Get system ID information
var request = webOS.service.request('luna://com.webos.service.sm', {
method: 'deviceid/getIDs',
parameters: {
idType: ['LGUDID'],
},
onSuccess: function (inResponse) {
console.log('Result: ' + JSON.stringify(inResponse));
// To-Do something
},
onFailure: function (inError) {
console.log('Failed to get system ID information');
console.log('[' + inError.errorCode + ']: ' + inError.errorText);
// To-Do something
return;
},
});
Return example
// Success return
{
"idList": [
{
"idValue": "095f142a-xxxx-ac5d-xxxx-92c8be18xxxx",
"idType": "LGUDID"
}
],
"returnValue": true
}
// Failure return
{
"returnValue" : false,
"errorCode": "ERR.001",
"errorText": "Invalid Parameters"
}See also
Object
idList object
The object that consists of `idType` and `idValue`.
{
"idType": string,
"idValue": string
}Name | Required | Type | Description |
|---|---|---|---|
idType | Yes | String | Device ID Type |
idValue | Yes | String | Device ID Value |